Crates.io | facet-args |
lib.rs | facet-args |
version | 0.28.0 |
created_at | 2025-04-10 03:39:14.09265+00 |
updated_at | 2025-07-25 12:47:19.278323+00 |
description | Command-line argument parsing for the facet ecosystem |
homepage | |
repository | https://github.com/facet-rs/facet-args |
max_upload_size | |
id | 1627609 |
size | 201,489 |
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(())
# }
Licensed under either of:
at your option.