pub unsafe extern "C" fn getopt(
___argc: c_int,
___argv: *const *mut c_char,
__shortopts: *const c_char,
) -> c_intExpand description
Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS.
Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, ‘optopt’ is set to the option letter, and ‘?’ is returned.
The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in ‘optarg’.
If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU ‘getopt’.
The argument ‘–’ causes premature termination of argument scanning, explicitly telling ‘getopt’ that there are no more options.
If OPTS begins with ‘-’, then non-option arguments are treated as arguments to the option ‘\1’. This behavior is specific to the GNU ‘getopt’. If OPTS begins with ‘+’, or POSIXLY_CORRECT is set in the environment, then do not permute arguments.
For standards compliance, the ‘argv’ argument has the type char *const *, but this is inaccurate; if argument permutation is enabled, the argv array (not the strings it points to) must be writable.