| Option |
|
typedict |
| |
An
Option
provides a place for
getopt
to store information about the last error or last command line option
that was successfully processed.
The fields in an
Option
are:
| getopt |
A
Builtin
that can be used to proccess command line options.
| | optarg |
A
String
that is set to the last option's argument, or the empty string if
there was no argument.
An option letter or long option name that is followed by a single colon
in the descriptions passed to
getopt
requires an argument, two colons means the argument is optional,
and no colon means the option does not take an argument.
| | optchar |
An
int
that is the character listed in
optstr
that introduced the last option.
| | opterror |
A
String
that describes the error that occurred the last time
getopt
was called.
getopt
always stores an error message in
opterror
and returns
?
when it detects an error, so a
NULL
opterror
or a return values that is not
?
means the call was successful.
| | optind |
An
int
with an initial value of
1,
that is the index of the next argument in the
argv
array that is handed to
getopt.
optind
is automatically updated by
getopt
as it processes options in
argv,
so
optind
ends up as the index of the the first non-option argument in
argv
when
getopt
finishes processing options.
| | optstr |
A
String
with a default value of
"-+",
that lists all the characters that can introduce options.
| | optword |
A
String
that is set to the long option name that the last
getopt
call recognized, or
NULL
if the option was not a long name.
By default
getopt
returns
-
when long option name is recognized, however the description of the
long options passed to
getopt
can override the default return value.
|
|
Yoix is a registered trademark of AT&T Intellectual Property.
|