You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use clap::Parser;#[derive(Debug,Parser)]structArgs{/// Sets the USB device to use#[clap( short = 'd', required = true, group = "usb")]device:Option<u16>,/// Sets the time to wait for USB reads and writes#[clap( short = 't', required = true, group = "usb")]timeout:Option<u64>,}fnmain(){dbg!(Args::parse());}
Steps to reproduce the bug with the above code
$ cargo run -- -d 123 -t 123
# output from clap "debug" feature is omittederror: The argument '-d <DEVICE>' cannot be used with '-t <TIMEOUT>'USAGE: program-name -d <DEVICE>For more information try --help
Actual Behaviour
device and timeout don't conflict with each other, yet they cannot both be present. Also, if one of them is missing, clap gives an error saying that the other was not provided.
Expected Behaviour
device and timeout should be able to both be present, since they don't conflict.
Additional Context
I filed #3330 a little bit ago, and I believe the fix for this, or at least a commit after v3.0.10 introduced this. That issue will have some more context.
Follow-up question: is there a way to set ArgGroup::multiple to true using the derive feature? If I put it in the same attribute, it can't find it because it looks for methods from Arg.
Please complete the following tasks
Rust Version
rustc 1.58.1 (db9d1b20b 2022-01-20)
Clap Version
3.0.12
Minimal reproducible code
Steps to reproduce the bug with the above code
Actual Behaviour
device
andtimeout
don't conflict with each other, yet they cannot both be present. Also, if one of them is missing, clap gives an error saying that the other was not provided.Expected Behaviour
device
andtimeout
should be able to both be present, since they don't conflict.Additional Context
I filed #3330 a little bit ago, and I believe the fix for this, or at least a commit after v3.0.10 introduced this. That issue will have some more context.
Debug Output
The text was updated successfully, but these errors were encountered: