#clap #flags #verbose #clap-parser #output #verbosity #warnings

clap-verbosity

Easily add a --verbose flag to CLIs using Clap

1 stable release

2.1.0 Dec 11, 2023

#6 in #verbosity

Download history 23/week @ 2024-07-28 30/week @ 2024-08-04 130/week @ 2024-08-11 104/week @ 2024-08-18 58/week @ 2024-08-25 56/week @ 2024-09-01 31/week @ 2024-09-08 53/week @ 2024-09-15 265/week @ 2024-09-22 74/week @ 2024-09-29 232/week @ 2024-10-06 347/week @ 2024-10-13 81/week @ 2024-10-20 296/week @ 2024-10-27 535/week @ 2024-11-03

1,294 downloads per month
Used in 2 crates

MIT/Apache

20KB
269 lines

clap-verbosity

Documentation License crates.io

Easily add a --verbose flag to CLIs using Clap

Examples

use clap::Parser;

// ...
#[derive(Debug, Parser)]
struct Cli {
    #[command(flatten)]
    verbose: clap_verbosity_flag::Verbosity,
}

By default, it'll only report errors.

  • -q silences output
  • -v show warnings
  • -vv show info
  • -vvv show debug
  • -vvvv show trace

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.3–2MB
~40K SLoC