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

std.getopt: make it an error to have options that differ only by case when case insensitive #10355

Open
dlangBugzillaToGithub opened this issue Oct 26, 2018 · 0 comments
Labels
Arch:x86_64 Issues specific to x86_64 OS:Linux Issues specific to Linux Severity:Normal

Comments

@dlangBugzillaToGithub
Copy link

dhasenan (@dhasenan) reported this on 2018-10-26T04:32:17Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=19335

Description

void main(string[] args)
{
    import std.getopt;
    import std.stdio;
    int a, A;
    getopt(args, "a", &a, "A", &A);
    writefln("a=%s, A=%s", a, A);
}

Compile, run with `-a 5 -A 10`.

The expected result is an exception saying that option `A|a` is multiply defined, hopefully also mentioning that the case-sensitive flag exists.

The actual result is that `a` is set twice and `A` is not set.

This exception should also trigger when you define an argument named `H`.

(I would also argue that case-insensitive is a terrible default, but that's unlikely to change.)
@LightBender LightBender removed the P3 label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch:x86_64 Issues specific to x86_64 OS:Linux Issues specific to Linux Severity:Normal
Projects
None yet
Development

No branches or pull requests

2 participants