facet-args 0.1.10

Command-line argument parsing for the facet ecosystem
Documentation

experimental free of syn crates.io documentation MIT/Apache-2.0 licensed

Logo by Misiasart

Thanks to all individual and corporate sponsors, without whom this work could not exist:

Provides CLI argument parsing (WIP).

use facet_pretty::FacetPretty;

#[test]
fn test_arg_parse() {
    use facet::Facet;

    #[derive(Facet)]
    struct Args {
        #[facet(positional)]
        path: String,

        #[facet(named, short = 'v')]
        verbose: bool,

        #[facet(named, short = 'j')]
        concurrency: usize,
    }

    let args: Args = facet_args::from_slice(&["--verbose", "--concurrency", "14", "example.rs"]);
    eprintln!("args: {}", args.pretty());
}

License

Licensed under either of:

at your option.