145 #define getopt_long getoptions_long
164 getopt_long(
int argc,
char * argv[],
const char *optstr,
165 struct option const *longopts,
int *longind);
The option cannot have an argument.
int val
Value to be returned or stored by getopt_long().
const char * name
The name of the option.
Info structure for an option for getopt_long().
int getopt_long(int argc, char *argv[], const char *optstr, struct option const *longopts, int *longind)
Parse commandline options.
bool opts_are_compatible(int opt_excluder, int opt_excluded, struct exclusion_list const *exclusions, bool indexed)
Say whether options are compatible with respect to specified incompatibilities.
const char * name
The name of the option.
int const * excluded
This 0-terminated list of option codes is excluded by excluder.
int cmd_code
Value to be returned if the command is matched.
The option must have an argument.
char * optarg
Argument to an option parsed by getopt_long()
cmd_option const * get_command_option(int argc, char *argv[], cmd_option const *commands)
Look for a command option at the start of commandline arguments.
int optopt
Unrecogised short option parsed by getopt_long()
Info structure for a command option for get_command()
int optind
Index of option parsed by getopt_long()
const char * get_long_opt_name(struct option const *longopts, int opt)
Look up the long name of the an option in an array of struct option.
int has_arg
Can the option take an argument? One of:
int excluder
This option code excludes the others.
Structure representing a set of options that are excluded by another option.
The option may or may not have an argument.