3 getopt \- get option character from command line
17 char *\fBoptprogname\fP;
21 int \fBgetopt(\fP\fIargc,argv,opts\fR\fB)\fP;
29 This is a clone version of
38 for a detailed description of
41 The main difference between
49 To turn off these error messages, set
59 There are two uses for this variable:
69 attempts to initialize
73 stripping the directory name.
74 The calling program can use
79 This is appropriate if the name of the program should be
80 determined from its command line.
87 of any error messages.
88 So the calling program can,
94 This is appropriate if the name of the program should not be
95 determined from its command line.
106 are specific to this clone version of
109 Many features of this clone version of
111 are poorly defined, if available at all,
114 For example, the standard
116 interface does not define
118 until the end of the option list.
125 an option which takes an argument.
126 In this clone version,
130 always indicate the next character to be read,
134 the current option does not take an argument.
137 for precise definitions of the parsing procedure.
139 When it reaches the end of the option list,
146 which is initialized to
148 which is defined as \-1.
149 The standard behavior is to return
154 on any weird machine where
155 EOF is different from \-1.
156 The calling program could set
158 to EOF to imitate the standard behavior.
160 Like most versions of
162 this clone version allows, but does not demand, that
164 separated from the option by whitespace, i.e., be
165 in the next command-line argument.
173 is incompatible across systems:
177 uses it the same way that this clone version uses
183 indicate the last option character returned by
185 This clone version does not provide
189 is strongly discouraged.
193 do not recognize a double hyphen as the end of arguments.
194 This version allows a double hyphen, or in fact any argument beginning
197 A lone hyphen is always recognized as the end of arguments.
200 allow lone hyphens as options.
201 This practice is wrong and is strongly discouraged.
204 is actually a macro abbreviation for
220 These macros are defined in
225 Further macros are defined in
233 getopt version 1.9, 931129.
235 Placed into the public domain by Daniel J. Bernstein.