ecla
===
[![docs](https://docs.rs/ecla/badge.svg?version=1.0.0 "docs")](https://docs.rs/ecla)
Simple command line arguments parser for Rust.
## [Document](https://docs.rs/ecla)
## Usage
Add dependency to Cargo.toml
```toml
[dependencies]
ecla = "1.0.0"
```
In your `main.rs`:
```rust
extern crate ecla;
use ecla::App;
const HELP: &'static str = "This is help message";
const VERSION: &'static str = "1.0.0";
fn main() {
let app = App::new(HELP, VERSION);
if let Some(command) = app.get_command("test") {
if let Some(flag) = command.get_flag(&["-a", "--all"]) {
println!("You have run subcommand test with flag -a or --all");
} else {
println!("You have run subcommand test with no flag");
}
} else {
app.show_unknown_or_help();
}
}
```
## Examples
For more usage, see the [examples](examples) folder
## Examples Screenshots
![Screenshot](http://i.imgur.com/fbysXIL.png "Screenshot")
![Screenshot](http://i.imgur.com/y2pvhAi.png "Screenshot")
## License
ecla is primarily distributed under the terms of the MIT license.
See [LICENSE](LICENSE) for details.