31 releases (14 breaking)
Uses new Rust 2024
new 0.18.3 | May 2, 2025 |
---|---|
0.17.0 | Apr 26, 2025 |
#94 in Command-line interface
3,159 downloads per month
510KB
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() -> 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
~395KB