facet-args 0.15.0

Command-line argument parsing for the facet ecosystem
Documentation

Coverage Status 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;
use facet::Facet;

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

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

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

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

License

Licensed under either of:

at your option.