Struct argonaut::ArgDef
[−]
[src]
pub struct ArgDef<T: Borrow<str>> { pub deftype: DefType<T>, pub help: Option<T>, }
The definition of one or more arguments to expect when parsing.
Fields
deftype: DefType<T>
The type/data of the definition.
help: Option<T>
An optional help string.
Methods
impl<T: Borrow<str>> ArgDef<T>
[src]
fn positional(name: T) -> ArgDef<T>
Creates the definition for a positional argument with the given name.
fn required_trail() -> ArgDef<T>
Creates the definition for a trail of one or more arguments.
fn optional_trail() -> ArgDef<T>
Creates the definition for a trail of zero or more arguments.
fn named(name: T) -> PartialArgDef<T>
Starts creating a new optional argument with the given long name.
This means that this definition is used when the name is given as an
argument, prefixed with two dashes (eg. "help" => --help
).
fn named_and_short(name: T, short: char) -> PartialArgDef<T>
Starts creating a new optional argument with the given long name.
This means that this definition is used when the name is given as an
argument, prefixed with two dashes (eg. "help" => --help
).
The short argument is for single-character abbreviations
(eg. "a" => -a
).
fn set_help(&mut self, help: T) -> &mut Self
Sets the help message for this argument.
fn set_parameter(&mut self, param: T) -> &mut Self
Sets the parameter name for this argument (used for help messages).
Trait Implementations
impl<T: Debug + Borrow<str>> Debug for ArgDef<T>
[src]
impl<T: Clone + Borrow<str>> Clone for ArgDef<T>
[src]
fn clone(&self) -> ArgDef<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more