ace 0.0.2

Parsing command line arguments
Documentation

Ace

Build Status Crates.io LICENSE

A simple command line parameter parsing library

Install

Add this in your Cargo.toml:

[dependencies]
ace = "0.0.2"

Example

use ace::App;

let app = App::new("ace", env!("CARGO_PKG_VERSION"))
    .cmd("start", "Start now")
    .cmd("help", "Display help information")
    .cmd("version", "Display version information")
    .opt("--config", "Use configuration file");

if let Some(cmd) = app.command() {
    match cmd.as_str() {
        "start" => {
            dbg!(app.value("--config"));
        }
        "help" => {
            app.help();
        }
        "version" => {
            app.version();
        }
        _ => {
            app.error_try("help");
        }
    }
}