#include <evo/commandline.h>
template<class ConsoleT = Console>
struct evo::CommandLineT< ConsoleT >::Option
Used to set additional option/argument information.
◆ ~Option()
◆ addchoice()
Add one or more preset choices.
- This limits the option/argument value to one of the given choices – any other value will give an error
- Parameters
-
value | Choice values, separated by semi-colon (;) |
- Returns
- This
◆ addchoices()
Option& addchoices |
( |
const T & |
values | ) |
|
|
inline |
Add one or more preset choices from string list.
- Template Parameters
-
T | String list type (List, SubList, etc), inferred from argument |
- Parameters
-
values | List of string values to add as choices |
- Returns
- This
◆ default_value()
Set default value for option.
- The default value is used when this option/argument is not given
- The default is automatically appended to option/argument usage help
- Usage help may contain
${default}
to control where the default value is shown, otherwise the default is appended to it
- Returns
- This
◆ maxlen()
virtual Option& maxlen |
( |
uint |
len | ) |
|
|
pure virtual |
Set maximum value length, or max digits if required to be numeric.
- Any value that exceeds this max length will give an error
- Parameters
-
len | Maximum value length allowed, or max digits allowed if required to be numeric |
- Returns
- This
◆ multi()
virtual Option& multi |
( |
bool |
val = true | ) |
|
|
pure virtual |
Allow multiple values for option/argument.
- For options, the values will accumulate when the option is repeated (instead of replace the previous value)
- For arguments, the values will accumulate with each argument
- Parameters
-
val | Whether to allow multiple values, false for single value |
- Returns
- This
◆ numeric()
Require option/argument value to be numeric.
- Any value that isn't numeric (digits 0-9 only) will give an error
- Returns
- This
◆ required()
virtual Option& required |
( |
bool |
val = true | ) |
|
|
pure virtual |
Make this option/argument required.
- If a required option/argument is missing an error is given
- Parameters
-
val | Whether required, false to make optional |
- Returns
- This
The documentation for this struct was generated from the following file: