Open Maurdekye opened 11 months ago
To double check, do you mean num_args(0..))]
or num_args(0..=1))]
? num_args
controls how many values per flag, not how many values total.
If its num_args(0..))]
, then you likely want to use Vec<Vec<String>>
instead. It is an interesting idea though to support Vec<Option<String>>
for num_args(0..=1))]
.
i didn't know that's what the flags did; i was just trying to find a way to allow clap to accept a single option repeatedly, which may or may not accept values
Please complete the following tasks
Rust Version
rustc 1.76.0-nightly (4cb3beec8 2023-11-18)
Clap Version
clap = { version = "4.4.11", features = ["derive", "debug"] }
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run -- -s -s test -s
Actual Behaviour
Expected Behaviour
Additional Context
No response
Debug Output