45 releases (15 breaking)
Uses new Rust 2024
new 0.19.7 | May 24, 2025 |
---|---|
0.18.9 | May 10, 2025 |
#139 in Command-line interface
2,451 downloads per month
765KB
15K
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() -> Result<(), Box<dyn std::error::Error>> {
let args: Args = facet_args::from_slice(&["--verbose", "-j", "14", "example.rs"])?;
eprintln!("args: {}", args.pretty());
Ok(())
# }
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
~390KB