https://github.com/clap-rs/clap-verbosity-flag

Easily add a --verbose flag to CLIs using Clap

https://github.com/clap-rs/clap-verbosity-flag

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.6%) to scientific vocabulary

Keywords

clap cli rust

Keywords from Contributors

argument-parser command-line-parser parsed-arguments positional-arguments subcommands type-system plagiarism-checker snapshot-testing testing-tools superapp
Last synced: 6 months ago · JSON representation

Repository

Easily add a --verbose flag to CLIs using Clap

Basic Info
Statistics
  • Stars: 213
  • Watchers: 5
  • Forks: 24
  • Open Issues: 7
  • Releases: 0
Topics
clap cli rust
Created almost 8 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License

README.md

clap-verbosity-flag for log / tracing

Documentation License crates.io

Easily add --verbose and --quiet flags to CLIs using Clap.

Examples

console $ cargo add clap-verbosity-flag

```rust use clap::Parser;

[derive(Debug, Parser)]

struct Cli { #[command(flatten)] verbosity: clapverbosityflag::Verbosity, }

fn main() { let args = Cli::parse(); envlogger::Builder::new() .filterlevel(args.verbosity.into()) .init(); // Your code here } ```

For tracing support, use the tracing feature:

console $ cargo add clap-verbosity-flag --no-default-features --features tracing

```rust use clap::Parser;

[derive(Debug, Parser)]

struct Cli { #[command(flatten)] verbosity: clapverbosityflag::Verbosity, }

fn main() { let args = Cli::parse(); tracingsubscriber::fmt() .withmax_level(args.verbosity) .init(); // Your code here } ```

The default verbosity level will cause log / tracing to only report errors. The flags can be specified multiple times to increase or decrease the verbosity level. See the Documentation for info on how to change the default verbosity level.

  • silence output: -q / --quiet
  • show warnings: -v / --verbose
  • show info: -vv / --verbose --verbose
  • show debug: -vvv / --verbose --verbose --verbose
  • show trace: -vvvv / --verbose --verbose --verbose --verbose

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.

Owner

  • Name: clap-rs
  • Login: clap-rs
  • Kind: organization

Crates related to clap (Argument Parsing Framework in Rust)

GitHub Events

Total
  • Issues event: 8
  • Watch event: 27
  • Delete event: 13
  • Issue comment event: 74
  • Push event: 28
  • Pull request review event: 47
  • Pull request review comment event: 56
  • Pull request event: 47
  • Create event: 15
Last Year
  • Issues event: 8
  • Watch event: 27
  • Delete event: 13
  • Issue comment event: 74
  • Push event: 28
  • Pull request review event: 47
  • Pull request review comment event: 56
  • Pull request event: 47
  • Create event: 15

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 303
  • Total Committers: 19
  • Avg Commits per committer: 15.947
  • Development Distribution Score (DDS): 0.337
Past Year
  • Commits: 78
  • Committers: 6
  • Avg Commits per committer: 13.0
  • Development Distribution Score (DDS): 0.462
Top Committers
Name Email Commits
Ed Page e****e@g****m 201
renovate[bot] 2****] 52
Josh McKinney j****a 14
Ed Page e****e@d****m 9
Yoshua Wuyts y****s@g****m 5
Pavan Kumar Sunkara p****1@g****m 4
Pascal Hertleif k****p@g****m 4
Peter Kehl p****l@g****m 2
Bradley Odell b****l@h****m 2
Wolf Vollprecht w****t@g****m 1
Tilda 6****a 1
Liana Pigeot 3****a 1
Josh Triplett j****h@j****g 1
Jalil David Salamé Messina 6****e 1
Hadrien G. k****i@g****m 1
Erdem e****r@g****m 1
Dawid Ciężarkiewicz d****c@d****w 1
dependabot-preview[bot] 2****] 1
futreall 8****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 31
  • Total pull requests: 123
  • Average time to close issues: 5 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 24
  • Total pull request authors: 25
  • Average comments per issue: 3.61
  • Average comments per pull request: 1.15
  • Merged pull requests: 98
  • Bot issues: 2
  • Bot pull requests: 59
Past Year
  • Issues: 4
  • Pull requests: 41
  • Average time to close issues: 3 months
  • Average time to close pull requests: 11 days
  • Issue authors: 2
  • Pull request authors: 3
  • Average comments per issue: 5.5
  • Average comments per pull request: 1.61
  • Merged pull requests: 35
  • Bot issues: 0
  • Bot pull requests: 24
Top Authors
Issue Authors
  • yoshuawuyts (4)
  • epage (3)
  • joshka (3)
  • renovate[bot] (2)
  • MiSawa (1)
  • Zykino (1)
  • pflakus (1)
  • SUPERCILEX (1)
  • drazisil (1)
  • khultman (1)
  • hydra (1)
  • chrysn (1)
  • cardil (1)
  • Eolien55 (1)
  • github-actions[bot] (1)
Pull Request Authors
  • renovate[bot] (76)
  • epage (28)
  • joshka (22)
  • yoshuawuyts (4)
  • dependabot[bot] (3)
  • wolfv (2)
  • khultman (2)
  • mtilda (2)
  • BTOdell (2)
  • pksunkara (2)
  • swfsql (1)
  • dependabot-preview[bot] (1)
  • edemir (1)
  • vhdirk (1)
  • ShayBox (1)
Top Labels
Issue Labels
enhancement (4) bug (1) good first issue (1)
Pull Request Labels

Dependencies

Cargo.toml cargo
  • env_logger 0.9.0 development
  • tracing 0.1 development
  • tracing-log 0.1.3 development
  • tracing-subscriber 0.3 development
  • clap 3.0
  • log 0.4.1
.github/workflows/audit.yml actions
  • actions-rs/audit-check v1 composite
  • actions/checkout v3 composite
.github/workflows/ci.yml actions
  • Swatinem/rust-cache v2 composite
  • actions-rs/clippy-check v1 composite
  • actions-rs/toolchain v1 composite
  • actions/checkout v3 composite
.github/workflows/committed.yml actions
  • actions/checkout v3 composite
  • crate-ci/committed master composite
.github/workflows/pre-commit.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pre-commit/action v3.0.0 composite
.github/workflows/rust-next.yml actions
  • Swatinem/rust-cache v2 composite
  • actions-rs/clippy-check v1 composite
  • actions-rs/toolchain v1 composite
  • actions/checkout v3 composite
.github/workflows/spelling.yml actions
  • actions/checkout v3 composite
  • crate-ci/typos master composite
Cargo.lock cargo
  • aho-corasick 0.7.18
  • ansi_term 0.12.1
  • bitflags 1.3.2
  • cc 1.0.79
  • cfg-if 1.0.0
  • clap 4.0.0
  • clap_derive 4.0.0
  • clap_lex 0.3.0
  • env_logger 0.10.0
  • errno 0.2.8
  • errno-dragonfly 0.1.2
  • heck 0.4.0
  • hermit-abi 0.2.6
  • humantime 2.1.0
  • io-lifetimes 1.0.5
  • is-terminal 0.4.2
  • lazy_static 1.4.0
  • libc 0.2.139
  • linux-raw-sys 0.1.4
  • log 0.4.17
  • memchr 2.5.0
  • once_cell 1.12.0
  • os_str_bytes 6.1.0
  • pin-project-lite 0.2.9
  • proc-macro-error 1.0.4
  • proc-macro-error-attr 1.0.4
  • proc-macro2 1.0.44
  • quote 1.0.18
  • regex 1.5.6
  • regex-syntax 0.6.26
  • rustix 0.36.7
  • sharded-slab 0.1.4
  • smallvec 1.8.0
  • syn 1.0.96
  • termcolor 1.1.3
  • thread_local 1.1.4
  • tracing 0.1.35
  • tracing-attributes 0.1.21
  • tracing-core 0.1.27
  • tracing-log 0.1.3
  • tracing-subscriber 0.3.11
  • unicode-ident 1.0.0
  • valuable 0.1.0
  • version_check 0.9.4
  • winapi 0.3.9
  • winapi-i686-pc-windows-gnu 0.4.0
  • winapi-util 0.1.5
  • winapi-x86_64-pc-windows-gnu 0.4.0
  • windows-sys 0.42.0
  • windows-sys 0.45.0
  • windows-targets 0.42.1
  • windows_aarch64_gnullvm 0.42.1
  • windows_aarch64_msvc 0.42.1
  • windows_i686_gnu 0.42.1
  • windows_i686_msvc 0.42.1
  • windows_x86_64_gnu 0.42.1
  • windows_x86_64_gnullvm 0.42.1
  • windows_x86_64_msvc 0.42.1