pub struct Argument {
    pub value: Option<&'static str>,
    pub value_mode: ArgumentValueMode,
    pub short: Option<char>,
    pub long: &'static str,
    pub help: &'static str,
}
Expand description

Information about an argument expected from the command line.

Examples

To indicate a flag style argument:

Argument::short_flag('f', "flag", "enable awesome mode");

To indicate a parameter style argument that expects a value:

// "VALUE" and "NETMASK" are placeholder values displayed in the help message for these
// arguments.
Argument::short_value('v', "val", "VALUE", "how much do you value this usage information");
Argument::value("netmask", "NETMASK", "hides your netface");

To indicate an argument with no short version:

Argument::flag("verbose", "this option is hard to type quickly");

To indicate a positional argument:

Argument::positional("VALUES", "these are positional arguments");

Fields

value: Option<&'static str>

The name of the value to display in the usage information.

value_mode: ArgumentValueMode

Specifies how values should be handled for this this argument.

short: Option<char>

Optional single character shortened argument name.

long: &'static str

The long name of this argument.

help: &'static str

Helpfuly usage information for this argument to display to the user.

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.