Struct commands::parser::Parameter [] [src]

pub struct Parameter<'a> { /* fields omitted */ }

Description of a parameter to be added to the Command.

The lifetime parameter 'a refers to the lifetime of the strings used for parameter names, aliases and help text.

Methods

impl<'a> Parameter<'a>
[src]

Construct a default (blank) parameter with the given name.

Mark the parameter as hidden. Hidden parameters will match within the parser, but are not listed during completion.

Give the parameter a priority. This is used when sorting out conflicts during matching and completion.

The priority of a Parameter defaults to PRIORITY_PARAMETER except for when the kind is ParameterKind::Flag in which case, the default will be PRIORITY_DEFAULT.

This is not commonly needed.

Establish whether or not this parameter is repeatable. Repeated parameters produce a vector of values and can be given multiple times within a single command invocation.

Add an alias that this parameter can use.

Aliases are currently only valid for parameters of kind ParameterKind::Named.

Supply the help text for the parameter.

Establish whether or not this parameter is required.

Set which type of ParameterNode is supposed to be created to represent this parameter.