.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2. .TH GENGETOPT "1" "September 2011" "gengetopt 2.22.5" "User Commands" .SH NAME gengetopt \- skeleton main.c generator .SH SYNOPSIS .B gengetopt [\fIOPTIONS\fR]... .SH DESCRIPTION GNU gengetopt 2.22.5 .PP This program generates a C function that uses getopt_long function to parse the command line options, validate them and fill a struct. .TP \fB\-h\fR, \fB\-\-help\fR Print help and exit .TP \fB\-\-detailed\-help\fR Print help, including all details and hidden options, and exit .TP \fB\-V\fR, \fB\-\-version\fR Print version and exit .PP Main options: .TP \fB\-i\fR, \fB\-\-input\fR=\fIfilename\fR input file (default std input) .TP \fB\-f\fR, \fB\-\-func\-name\fR=\fIname\fR name of generated function (default=`cmdline_parser') .TP \fB\-a\fR, \fB\-\-arg\-struct\-name\fR=\fIname\fR name of generated args info struct (default=`gengetopt_args_info') .TP \fB\-F\fR, \fB\-\-file\-name\fR=\fIname\fR name of generated file (default=`cmdline') .TP \fB\-\-output\-dir\fR=\fIpath\fR output directory .IP if this option is not specified, the files are generated in the current directory. .TP \fB\-\-header\-output\-dir\fR=\fIpath\fR header output directory .TP \fB\-\-src\-output\-dir\fR=\fIpath\fR source output directory .TP \fB\-c\fR, \fB\-\-c\-extension\fR=\fIext\fR extension of c file (default=`c') .TP \fB\-H\fR, \fB\-\-header\-extension\fR=\fIext\fR extension of header file (default=`h') .TP \fB\-l\fR, \fB\-\-long\-help\fR long usage line in help .IP The usage line will print all the options, e.g., .IP sample1 \fB\-iINT\fR|\-\-int\-opt=INT [\-h|\-\-help] .TP \fB\-\-default\-optional\fR by default, an option is considered optional if not specified otherwise .TP \fB\-u\fR, \fB\-\-unamed\-opts\fR[=\fISTRING\fR] accept options without names (e.g., file names) (default=`FILES') .PP The parser generated is thought to be used to parse the command line arguments. However, you can also generate parsers for configuration files, or strings that contain the arguments to parse, by using the following two options. .TP \fB\-C\fR, \fB\-\-conf\-parser\fR generate a config file parser .TP \fB\-S\fR, \fB\-\-string\-parser\fR generate a string parser (the string contains the command line) .SS "Additional options:" .TP \fB\-G\fR, \fB\-\-include\-getopt\fR adds the code for getopt_long in the generated C file .TP \fB\-n\fR, \fB\-\-no\-handle\-help\fR do not handle \fB\-\-help\fR|\-h automatically .IP If \fB\-\-no\-handle\-help\fR is specified, the command line option \fB\-\-help\fR|\-h will not be handled automatically, so the programmer will be able to print some other information; then the function for printing the standard help output can be used; this function is called _print_help. .IP Notice that, although the programmer can handle \fB\-\-help\fR|\-h manually, the parser will return after finding such option: the other command line options, if any, will be ignored. In case you want to have full control on \fB\-\-help\fR|\-h, you should use \fB\-\-ho\-help\fR. .TP \fB\-\-no\-help\fR do not add \fB\-\-help\fR|\-h automatically .IP With this option you can disable the automatic addition of options \fB\-\-help\fR|\-h. The programmer will then be able to add this option in the input file and handle it as he sees fit. Notice that \fB\-\-no\-help\fR will also disable the automatic options \fB\-\-detailed\-help\fR and \fB\-\-full\-help\fR. .IP The programmer can still define options with short character h as he wants, but he cannot define options help, unless he specifies \fB\-\-no\-help\fR (otherwise an error will be printed). .TP \fB\-N\fR, \fB\-\-no\-handle\-version\fR do not handle \fB\-\-version\fR|\-V automatically .TP \fB\-\-no\-version\fR do not add \fB\-\-version\fR|\-V automatically .IP See above the details about \fB\-\-no\-handle\-help\fR and \fB\-\-no\-help\fR, respectively. .TP \fB\-e\fR, \fB\-\-no\-handle\-error\fR do not exit on errors .IP With this option, if the generated parser encounters an error (e.g., an unknown option) it does not make the main program exit; instead, the parser function returns a value different 0, and the main program can print a help message. .TP \fB\-\-show\-required\fR[=\fISTRING\fR] in the output of help will specify which options are mandatory, by using the optional passed string (default=`(mandatory)') .TP \fB\-g\fR, \fB\-\-gen\-version\fR put gengetopt version in the generated file (default=on) .TP \fB\-\-set\-package\fR=\fISTRING\fR set the package name (override package defined in the .ggo file) .TP \fB\-\-set\-version\fR=\fISTRING\fR set the version number (override version defined in the .ggo file) .TP \fB\-\-show\-help\fR show the output of \fB\-\-help\fR instead of generating code .TP \fB\-\-show\-full\-help\fR show the output of \fB\-\-full\-help\fR (i.e., including hidden options) instead of generating code .TP \fB\-\-show\-detailed\-help\fR show the output of \fB\-\-detailed\-help\fR (i.e., including details and hidden options) instead of generating code .TP \fB\-\-show\-version\fR show the output of \fB\-\-version\fR instead of generating code .PP Please refer to the info manual for further explanations. .PP Maintained by Lorenzo Bettini .SH "REPORTING BUGS" Report bugs to .SH COPYRIGHT Copyright \(co 1999\-2009 Free Software Foundation Inc. This program comes with ABSOLUTELY NO WARRANTY; for details please see the file 'COPYING' supplied with the source code. .br This is free software, and you are welcome to redistribute it under certain conditions; again, see 'COPYING' for details. This program is released under the GNU General Public License. .SH "SEE ALSO" The full documentation for .B gengetopt is maintained as a Texinfo manual. If the .B info and .B gengetopt programs are properly installed at your site, the command .IP .B info gengetopt .PP should give you access to the complete manual.