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