Struct bdrck_params::option::Option [] [src]

pub struct Option {
    pub name: String,
    pub help: String,
    pub short_name: Optional<char>,
    pub default_value: Optional<String>,
    pub is_optional: bool,
    pub is_flag: bool,
}

An option is a non-positional parameter to a command. Options can either be normal options or flags. Normal options must be passed by name along with a value. Flags are options whose value is either true or false, and is false by default. Passing a flag by name means flipping its value to true.

Fields

Methods

impl Option
[src]

Constructs a required option. This option may have a default value. But, importantly, it will always have some value inside the command function.

Construct an optional value. This option does not have a default value, and it may have no value to access inside the command function.

Construct a flag option. This option's value is either true or false, and is false unless it is explicitly passed to the command as an argument.

Trait Implementations

impl Clone for Option
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Option
[src]

Formats the value using the given formatter.