Crater Container Library 0.2.0
|
|
General configuration settings for parsing options. More...
#include <opts.h>
Data Fields | |
void * | data |
Custom data for on_arg if needed. | |
uint64_t | flags |
Flags to control option parsing Can be zero or more of the following or'd together: CR8R_OPTS_FATAL_ERRS: if set, option parsing will stop after the first error instead of trying to find all errors before failing CR8R_OPTS_ALLOW_STRAY_DASH: if set, a command line argument "-" is treated as a positional argument instead of an errors CR8R_OPTS_CB_ON_DD: if set, the callback is called on the argument processing terminator "--". More... | |
bool(* | on_arg )(void *data, int argc, char **argv, int i) |
Callback to handle positional arguments. More... | |
uint64_t cr8r_opt_cfg::flags |
Flags to control option parsing Can be zero or more of the following or'd together: CR8R_OPTS_FATAL_ERRS: if set, option parsing will stop after the first error instead of trying to find all errors before failing CR8R_OPTS_ALLOW_STRAY_DASH: if set, a command line argument "-" is treated as a positional argument instead of an errors CR8R_OPTS_CB_ON_DD: if set, the callback is called on the argument processing terminator "--".
Note it is always called on subsequent "--".
bool(* cr8r_opt_cfg::on_arg) (void *data, int argc, char **argv, int i) |
Callback to handle positional arguments.
Command line arguments beginning with "-" are either short option groups or long options. An argument not beginning with "-" following one that does is considered an argument to the latter. Any other argument, or any argument after "--" which terminates option parsing, is considered a positional argument.