Struct clean_cli::Cli[][src]

pub struct Cli<R: Default> { /* fields omitted */ }
Expand description

Cli is a central unit that contains all possible commands, arguments and handlers. To create instance using build pattern. Generic parameter using for return values from handlers.

Example

use clean_cli::*;

let cli = Cli::<bool>::builder()
     .command(CommandBuilder::with_name("cmd")
         .handler(|ctx| {
             // some logic
             return true;
         })
     )
     .build();

assert!(cli.exec_line("cmd").unwrap());

Implementations

Create builder

Execute line

Trait Implementations

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

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.