12 releases
Uses new Rust 2024
new 0.3.0 | Apr 12, 2025 |
---|---|
0.2.0 | Apr 12, 2025 |
0.1.12 | Apr 11, 2025 |
#159 in Command-line interface
799 downloads per month
405KB
8K
SLoC
facet-args
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());
}
Dependencies
~240KB