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

Download history 195/week @ 2025-04-04 1168/week @ 2025-04-11 1148/week @ 2025-04-18 648/week @ 2025-04-25

3,159 downloads per month

MIT/Apache

510KB
10K SLoC

Facet logo - a reflection library for Rust

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

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

~395KB