5 stable releases

1.2.0 Apr 30, 2019
1.1.4 Apr 30, 2019
1.1.3 Apr 25, 2019
1.1.2 Apr 24, 2019
1.0.0 Apr 21, 2019

#1086 in Math


Used in commander-rust

MIT license

37KB
824 lines

This crate is using for commander_rust.

Only Application, Cli, Raw you will use.

Application will be returned by macro run!(). It's readonly. You can get application information through it. Application contains all information you defined using #[option] ,#[command] and #[entry]. See Application for more details.

Cli is an interface of CLI. You can get all argument of options through it. Cli offered two convenient method to get argument of options. They are get(idx: &str) -> Raw and get_or<T: From<Raw>>(&self, idx: &str, d: T) -> T. See Cli for more details.

Raw is encapsulation of something. It a sequence of String. You can regard it as Raw(<Vec<String>>). In fact, it is. Raw is using for types convert. Any type implemented From<Raw> can be types of command processing functions' parameter. For example, Vec<i32> implemented From<Raw>. So you can use it like fn method(v: Vec<i32>). But slice is not implemented From<Raw>, so you can not use it like fn method(s: [i32]). Once type implemented From<Raw>, you can covert it's type using let right: bool = raw.into().

Dependencies