30 using OptionSpan = std::span<const OptionData>;
31 using ArgumentSpan = std::span<char * const>;
35 const char *
opt =
nullptr;
36 const char *
cont =
nullptr;
OptionDataType
Flags of an option.
@ ODF_OPTIONAL_VALUE
An option with an optional value.
@ ODF_NO_VALUE
A plain option (no value attached to it).
@ ODF_HAS_VALUE
An option with a value.
Data storage for parsing command line options.
GetOptData(ArgumentSpan arguments, OptionSpan options)
Constructor of the data store.
ArgumentSpan arguments
Remaining command line arguments.
int GetOpt()
Find the next option.
const char * cont
Next call to GetOpt should start here (in the middle of an argument).
const OptionSpan options
Command line option descriptions.
const char * opt
Option value, if available (else nullptr).
OptionDataType type
The type of option.
char shortname
Short option letter if available, else use '\0'.
char id
Unique identification of this option data, often the same as shortname.
const char * longname
Long option name including '-'/'–' prefix, use nullptr if not available.