Arguments.Argument

A specific argument instance. You get one of these from Arguments.get() and visit them via Arguments.opApply()

Constructors

this
this(const(char)[] name)

Create with the given name

Members

Aliases

Inspector
alias Inspector = const(char)[] delegate(const(char)[] value)
Undocumented in source.
Invoker
alias Invoker = void delegate()
Undocumented in source.

Enums

None
anonymousenum None

Error identifiers:

Functions

aliased
Argument aliased(char name)

Alias this argument with the given name. If you need long-names to be aliased, create the long-name first and alias it to a short one

assigned
const(char[])[] assigned()

return the assigned parameters, or the defaults if no parameters were assigned

bind
Argument bind(Inspector inspector)

Set an inspector for this argument, fired when a parameter is appended to an argument. Return null from the delegate when the value is ok, or a text string describing the issue to trigger an error

bind
Argument bind(Invoker invoker)

Set an invoker for this argument, fired when an argument declaration is seen

conflicts
Argument conflicts(Argument arg)

Set this argument to conflict with another

conflicts
Argument conflicts(const(char)[] other)

Set this argument to conflict with another

conflicts
Argument conflicts(char other)

Set this argument to conflict with another

defaults
Argument defaults(const(char)[] values)

Add another default parameter for this argument

halt
Argument halt()

Fail the parse when this arg is encountered. You might use this for managing help text

help
Argument help(const(char)[] text)

Set the help text for this argument

params
Argument params()

Enable parameter assignment: 0 to 42 by default

params
Argument params(int count)

Set an exact number of parameters required

params
Argument params(int min, int max)

Set both the minimum and maximum parameter counts

requires
Argument requires(Argument arg)

Set this argument to depend upon another

requires
Argument requires(const(char)[] other)

Set this argument to depend upon another

requires
Argument requires(char other)

Set this argument to depend upon another

restrict
Argument restrict(const(char[])[] options)

Restrict values to one of the given set

smush
Argument smush(bool yes)

Enable smushing for this argument, where "-ofile" would result in "file" being assigned to argument 'o'

title
Argument title(const(char)[] name)

Alter the title of this argument, which can be useful for naming the default argument

toString
immutable(char)[] toString()

Return the name of this argument

Properties

explicit
Argument explicit [@property getter]

Disable implicit arguments

required
Argument required [@property getter]

Make this argument a requirement

Variables

aliases
char[] aliases;

Array of aliases

error
int error;

error condition

max
int max;

maximum params

min
int min;

minimum params

name
const(char)[] name;
Undocumented in source.
set
bool set;

arg is present

text
const(char)[] text;
Undocumented in source.

Meta