ArgStep.match

bool match(ArgStep* this, const ArgOption* option, overload out bool value)

Attempts to match the current argument as a bool option.

Bool options accept a present/absent value. In GNU syntax, a noPrefix option also accepts --no-name for false. Bool options may be matched more than once; each match calls the callback normally with the current value.

ArgStep*
this
const ArgOption*
option
overload out bool
value
bool match(ArgStep* this, const ArgOption* option, overload out const char[] value)

Attempts to match the current argument as a text option or operand.

For options, the value may be attached to the option token or supplied by the next argument. For operands, leave both flag and longFlag null in the ArgOption. The returned slice points into the argument storage supplied to parseArgs or insertArgs.

ArgStep*
this
const ArgOption*
option
overload out const char[]
value
bool match(ArgStep* this, const ArgOption* option, overload out string[] value)

Attempts to capture the remaining arguments.

This overload consumes the current match and returns every remaining argument in one array. It can be used with endOfFlags for ---style forwarding, or with any other flag that should capture the rest of the command line. The returned array is owned by the parser and remains valid only until the current callback returns.

ArgStep*
this
const ArgOption*
option
overload out string[]
value
bool match(ArgStep* this, const ArgOption* option, overload out uint value)

Attempts to match the current argument as an unsigned integer option or operand.

Parsing fails with INVALID_VALUE if the matched text is not a valid uint. Repeated matches require multiple = true.

ArgStep*
this
const ArgOption*
option
overload out uint
value

Generated with campc 0.11.0-preview.1.