Describes a single command-line option. More...
#include <cmdlineparser.h>

Public Types | |
| enum | ArgType { ArgNone , ArgBool , ArgString , ArgInt , ArgDouble , ArgUnknown } |
| Enumerates the argument types an option can accept. More... | |
Public Member Functions | |
| Option ()=default | |
| Default constructor. | |
| Option (char sn, const String &ln, const String &d, OptionCallbackVariant cb) | |
| Constructs an option with all fields. | |
| ArgType | argType () const |
| Returns the argument type inferred from the callback variant. | |
Public Attributes | |
| char | shortName = 0 |
| Single-character short option name, or 0 if none. | |
| String | longName |
| Long option name, or empty if none. | |
| String | desc |
| Description shown in usage/help text. | |
| OptionCallbackVariant | callback |
| Typed callback invoked when this option is parsed. | |
Describes a single command-line option.
Each option has an optional single-character short name, an optional long name, a description for help text, and a typed callback.
Enumerates the argument types an option can accept.
| Enumerator | |
|---|---|
| ArgNone | No argument required. |
| ArgBool | Boolean argument. |
| ArgString | String argument. |
| ArgInt | Integer argument. |
| ArgDouble | Double argument. |
| ArgUnknown | Unknown or unsupported type. |
|
inline |
Constructs an option with all fields.
| sn | Short name character (0 for none). |
| ln | Long name string. |
| d | Description for help text. |
| cb | Typed callback variant. |
|
inline |
Returns the argument type inferred from the callback variant.