Trait rustop::CommandLineArgument [] [src]

pub trait CommandLineArgument {
    fn parse_value(&mut self, arg: &str) -> Result<(), ArgError>;
fn write_name(&self, name: Option<&str>) -> Option<String>; fn set_default(&mut self) -> Result<(), ArgError> { ... }
fn set_unseen(&mut self) { ... }
fn is_multi(&self) -> bool { ... }
fn default_value(&self) -> Option<String> { ... } }

Trait for variables that can be used as option arguments.

Required Methods

Add the value from the command line string.

Return a description of a argument of this type.

name is a use-defined description (if any) of the underlying type. The function may add additional formatting.

Provided Methods

Called if the option has been specified without argument.

The method should return the error ArgError::MissingArgument if the argument is required.

Called if the argument has never been seen.

This method can be used to store a specific "never seen" value in the variable.

Return true if the argument can parsed multiple times.

Return the initial value as a string.

Implementors