getopts-macro 0.1.13

Use macros to cleanly define getopts options
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[cfg(not(feature = "std"))]
fn main() {
    eprintln!("only in feature = std");
    std::process::exit(1)
}

#[cfg(feature = "std")]
fn main() {
    use getopts_macro::{getopts_options, simple_parse};

    let options = getopts_options! {
        -h, --help          "show help message";
    };
    let matches = simple_parse(&options, "", 1, "<FILE..>");
    println!("files: {:?}", matches.free)
}