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