Struct Option
Defined in File Option.hpp
Struct Documentation
-
struct Option
Specifies a command-line option’s parameters.
Note
An open struct is used for this to enable keyword construction (e.g.,
Option opt{.name = {"--arg", "-a"}, .help = "Option description"};). See CliArgs.Public Members
-
std::string help = {}
Help description to be printed on request. Can be multiple lines.
-
bool required = {false}
Arguments are optional be default. This makes an argument required.
-
ArgType type = {ArgType::Unspecified}
The expected type to which a value should parse.
-
bool flag = {false}
This indicates that the option is a flag, and not followed by a value.
Flag options are automatically configured to be false by default and flip to true if parsed.
-
std::size_t nargs = {1}
The number of values that can be provided with an option.
-
bool positional = {false}
Consume values without an option name.
-
bool repeatable = {false}
Allow multiple occurrences, each taking nargs values.
-
std::string help = {}