[][src]Crate commander_core

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().

Structs

Application

Represents an application.

Cli

Something like Cmd.

Raw

Encapsulation of Vec<String>.

Functions

normalize