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

Short option names must be unique for each argument - Not detected during compilation #4816

Closed
2 tasks done
ohaddahan opened this issue Mar 31, 2023 · 1 comment
Closed
2 tasks done
Labels
C-bug Category: Updating dependencies

Comments

@ohaddahan
Copy link

Please complete the following tasks

Rust Version

rustc 1.67.1

Clap Version

4.2.0

Minimal reproducible code

#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
    #[arg(short, long)]
    file: String,
    #[arg(short, long)]
    mode: Mode,
    #[arg(short, long, requires = "mode")]
    speaker_0: Option<String>,
    #[arg(short, long, requires = "mode")]
    speaker_1: Option<String>,
}

fn main() {
    let args = Args::parse();
}

Steps to reproduce the bug with the above code

cargo run

Actual Behaviour

Short option names must be unique for each argument, but '-s' is in use by both 'speaker_0' and 'speaker_1''

Expected Behaviour

This can be detected during compile time and should fail then.

Additional Context

No response

Debug Output

No response

@ohaddahan ohaddahan added the C-bug Category: Updating dependencies label Mar 31, 2023
@epage
Copy link
Member

epage commented Mar 31, 2023

We are tracking this in #3133

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

2 participants