30 using OptionSpan = std::span<const OptionData>;
31 using ArgumentSpan = std::span<std::string_view>;
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.
std::string_view cont
Next call to GetOpt should start here (in the middle of an argument).
std::string_view opt
Option value, if available (else empty).
ArgumentSpan arguments
Remaining command line arguments.
int GetOpt()
Find the next option.
const OptionSpan options
Command line option descriptions.
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.
std::string_view longname
Long option name including '-'/'–' prefix, leave empty if not available.