Trait app::ArgsValueParse [] [src]

pub trait ArgsValueParse<'app>: Debug {
    fn into(self) -> ArgsValue<'app>;
    fn default(&self) -> Option<String>;
    fn parse(&mut self, args_name: &str, msg: &[String]) -> Result<(), String>;
    fn check(&self, args_name: &str) -> Result<(), String>;
}

You can use custom ArgsValue by impl it

Explain

  • into(self) convert it(&mut T) to ArgsValue.

  • default(&self) is Arguments's default value's str for help message print

  • parse(&mut self, args_name: String, msg: &[String]) maintains the value, and return message by Result<(),String>.

    args_name is current cmd's args_name, msg is the &[String] need to pasre.

  • check(&self, opt_name: &str) check value and return message by Result<(),String>.

Required Methods

Implementors