simon 0.4.0

Library for declaratively specifying and parsing command line arguments
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate simon;

use simon::*;

fn main() {
    match opt::<f32>("", "width", "", "")
        .depend(opt::<f32>("", "height", "", ""))
        .option_map(|(x, y)| (x, y))
        .option_map(|(x, y)| x * y)
        .required()
        .parse_env()
        .result
    {
        Ok(area) => println!("area: {:?}", area),
        Err(e) => panic!("{}", e),
    }
}