22 releases (8 breaking)
Uses new Rust 2024
new 0.12.0 | Apr 19, 2025 |
---|---|
0.10.1 | Apr 18, 2025 |
#124 in Command-line interface
1,727 downloads per month
475KB
10K
SLoC
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:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Dependencies
~240KB