File: gengetopt.1

package info (click to toggle)
gengetopt 2.22.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,952 kB
  • sloc: cpp: 14,600; sh: 10,537; ansic: 7,905; makefile: 678; yacc: 492; lex: 170; sed: 3
file content (188 lines) | stat: -rw-r--r-- 5,968 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
.\" 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 <parser\-name>_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 <http://www.lorenzobettini.it>
.SH "REPORTING BUGS"
Report bugs to <bug\-gengetopt at gnu.org>
.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.