1GENGETOPT(1) User Commands GENGETOPT(1)
2
3
4
6 gengetopt - manual page for gengetopt 2.22
7
9 gengetopt [OPTIONS]...
10
12 GNU gengetopt 2.22
13
14 This program generates a C function that uses getopt_long function to
15 parse the command line options, validate them and fill a struct.
16
17 -h, --help
18 Print help and exit
19
20 --detailed-help
21 Print help, including all details and hidden options, and exit
22
23 -V, --version
24 Print version and exit
25
26 Main options:
27
28 -i, --input=filename
29 input file (default std input)
30
31 -f, --func-name=name
32 name of generated function (default=`cmdline_parser')
33
34 -a, --arg-struct-name=name
35 name of generated args info struct (default=`genge‐
36 topt_args_info')
37
38 -F, --file-name=name
39 name of generated file (default=`cmdline')
40
41 --output-dir=path
42 output directory
43
44 if this option is not specified, the files are generated in the
45 current directory.
46
47 -c, --c-extension=ext
48 extension of c file (default=`c')
49
50 -H, --header-extension=ext
51 extension of header file (default=`h')
52
53 -l, --long-help
54 long usage line in help
55
56 The usage line will print all the options, e.g.,
57
58 sample1 -iINT|--int-opt=INT [-h|--help]
59
60 --default-optional
61 by default, an option is considered optional if not specified
62 otherwise
63
64 -u, --unamed-opts[=STRING]
65 accept options without names (e.g., file names)
66 (default=`FILES')
67
68 The parser generated is thought to be used to parse the command line
69 arguments. However, you can also generate parsers for configuration
70 files, or strings that contain the arguments to parse, by using the
71 following two options.
72
73 -C, --conf-parser
74 generate a config file parser
75
76 -S, --string-parser
77 generate a string parser (the string contains the command line)
78
79 Additional options:
80
81 -G, --include-getopt
82 adds the code for getopt_long in the generated C file
83
84 -n, --no-handle-help
85 do not handle --help|-h automatically
86
87 If --no-handle-help is specified, the command line option
88 --help|-h will not be handled automatically, so the programmer
89 will be able to print some other information; then the function
90 for printing the standard help output can be used; this function
91 is called <parser-name>_print_help.
92
93 Notice that, although the programmer can handle --help|-h manu‐
94 ally, the parser will return after finding such option: the
95 other command line options, if any, will be ignored. In case
96 you want to have full control on --help|-h, you should use
97 --ho-help.
98
99 --no-help
100 do not add --help|-h automatically
101
102 With this option you can disable the automatic addition of
103 options --help|-h. The programmer will then be able to add this
104 option in the input file and handle it as he sees fit. Notice
105 that --no-help will also disable the automatic options
106 --detailed-help and --full-help.
107
108 The programmer can still define options with short character h
109 as he wants, but he cannot define options help, unless he speci‐
110 fies --no-help (otherwise an error will be printed).
111
112 -N, --no-handle-version
113 do not handle --version|-V automatically
114
115 --no-version
116 do not add --version|-V automatically
117
118 See above the details about --no-handle-help and --no-help,
119 respectively.
120
121 -e, --no-handle-error
122 do not exit on errors
123
124 With this option, if the generated parser encounters an error
125 (e.g., an unknown option) it does not make the main program
126 exit; instead, the parser function returns a value different 0,
127 and the main program can print a help message.
128
129 --show-required[=STRING]
130 in the output of help will specify which options are mandatory,
131 by using the optional passed string (default=`(mandatory)')
132
133 -g, --gen-version
134 put gengetopt version in the generated file (default=on)
135
136 --set-package=STRING
137 set the package name (override package defined in the .ggo file)
138
139 --set-version=STRING
140 set the version number (override version defined in the .ggo
141 file)
142
143 --show-help
144 show the output of --help instead of generating code
145
146 --show-full-help
147 show the output of --full-help (i.e., including hidden options)
148 instead of generating code
149
150 --show-detailed-help
151 show the output of --detailed-help (i.e., including details and
152 hidden options) instead of generating code
153
154 --show-version
155 show the output of --version instead of generating code
156
157 Please refer to the info manual for further explanations.
158
159 Maintained by Lorenzo Bettini <http://www.lorenzobettini.it>
160
162 Report bugs to <bug-gengetopt at gnu.org>
163
165 Copyright © 1999-2007 Free Software Foundation Inc. This program
166 comes with ABSOLUTELY NO WARRANTY; for details please see the file
167 'COPYING' supplied with the source code.
168 This is free software, and you are welcome to redistribute it under
169 certain conditions; again, see 'COPYING' for details. This program is
170 released under the GNU General Public License.
171
173 The full documentation for gengetopt is maintained as a Texinfo manual.
174 If the info and gengetopt programs are properly installed at your site,
175 the command
176
177 info gengetopt
178
179 should give you access to the complete manual.
180
181
182
183gengetopt 2.22 January 2008 GENGETOPT(1)