#arguments-parser #facet

facet-args

Command-line argument parsing for the facet ecosystem

52 releases (15 breaking)

Uses new Rust 2024

0.19.14 Jun 4, 2025
0.19.10 May 31, 2025

#99 in Command-line interface

Download history 902/week @ 2025-04-08 1402/week @ 2025-04-15 707/week @ 2025-04-22 264/week @ 2025-04-29 785/week @ 2025-05-06 637/week @ 2025-05-13 513/week @ 2025-05-20 532/week @ 2025-05-27 572/week @ 2025-06-03

2,429 downloads per month

MIT/Apache

1MB
17K SLoC

Facet logo - a reflection library for Rust

Coverage Status free of syn crates.io documentation MIT/Apache-2.0 licensed Discord

Logo by Misiasart

Thanks to all individual and corporate sponsors, without whom this work could not exist:

Ko-fi GitHub Sponsors Patreon Zed Depot

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:

at your option.

Dependencies

~390KB