Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Clap error in examples/timestamp #55

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Conversation

kenoss
Copy link
Contributor

@kenoss kenoss commented Dec 31, 2022

Currently, examples/timestamp raises runtime error by violation of constraints of clap.

$ cargo run --example timestamp
   Compiling stderrlog v0.5.5-alpha.0 (/home/keno/src/github.com/cardoe/stderrlog-rs)
    Finished dev [unoptimized   debuginfo] target(s) in 0.52s
     Running `target/debug/examples/timestamp`
thread 'main' panicked at 'Argument "verbosity"
  Arg::is_takes_value_set is required when Arg::is_multiple_values_set is set.
', /home/keno/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.2.23/src/builder/debug_asserts.rs:746:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Arg::multiple() is deprecated in clap 3.* [1].
This PR uses Arg::multiple_occurrences() instead and fixes the error.

[1] https://docs.rs/clap/3.0.0/clap/struct.Arg.html#method.multiple

Currently, examples/timestamp raises runtime error by violation of
constraints of clap.

`Arg::multiple()` is deprecated in clap 3.* [1].
This PR uses `Arg::multiple_occurrences()` instead and fixes the error.

[1] https://docs.rs/clap/3.0.0/clap/struct.Arg.html#method.multiple
@cardoe cardoe merged commit de6760a into cardoe:master Jan 31, 2024
4 checks passed
@kenoss kenoss deleted the fix-clap-error branch March 20, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants