pub unsafe extern "C" fn aws_cli_getopt_long(
argc: c_int,
argv: *const *mut c_char,
optstring: *const c_char,
longopts: *const aws_cli_option,
longindex: *mut c_int
) -> c_int
Expand description
A mostly compliant implementation of posix getopt_long(). Parses command-line arguments. argc is the number of command line arguments passed in argv. optstring contains the legitimate option characters. The option characters coorespond to aws_cli_option::val. If the character is followed by a :, the option requires an argument. If it is followed by ‘::’, the argument is optional (not implemented yet).
longopts, is an array of struct aws_cli_option. These are the allowed options for the program. The last member of the array must be zero initialized.
If longindex is non-null, it will be set to the index in longopts, for the found option.
Returns option val if it was found, ‘?’ if an option was encountered that was not specified in the option string, 0x02 (START_OF_TEXT) will be returned if a positional argument was encountered. returns -1 when all arguments that can be parsed have been parsed.