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

Download history 555/week @ 2025-04-05 1166/week @ 2025-04-12

1,727 downloads per month

MIT/Apache

475KB
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 built with blacksmith

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:

at your option.

Dependencies

~240KB