arg_combinators 0.6.0

Command line argument combinators
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate arg_combinators;

use arg_combinators::*;

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