Option

Represents a command-line option with a parameter.

Constructors

this
this(string shortName, string longName, string paramName, string description, bool required, string defaultValue)

Constructs an option.

Members

Functions

formattedName
string formattedName(bool colors, bool padded)

Returns formatted name with parameter placeholder, e.g., -f, --foo <val>.

formattedName
string formattedName(bool padded)

Returns formatted name with parameter placeholder, e.g., -f, --foo <val>.

Static functions

fromString
Option fromString(string format, string description, string defaultValue)

Creates an option from a formatted string.

Variables

defaultValue
string defaultValue;

Default value of the parameter, or null.

paramName
string paramName;

Name of the parameter.

required
bool required;

Whether the option is required.

Inherited Members

From Flag

shortName
string shortName;

Single-character short name, or null.

longName
string longName;

Long name, or null.

description
string description;

Description of the flag.

PADDING_MISSING_SHORT
enum PADDING_MISSING_SHORT;

Placeholder for padding when there is no short option.

fromString
Flag fromString(string format, string description)

Creates a flag from a formatted string.

formattedName
string formattedName(bool padded)

Returns formatted name, e.g., -h, --help.

matches
bool matches(string query)

Checks whether the given query matches this flag.