Bug 19335 – std.getopt: make it an error to have options that differ only by case when case insensitive

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-10-26T04:32:17Z
Last change time
2024-12-01T16:34:22Z
Assigned to
No Owner
Creator
Neia Neutuladh
Moved to GitHub: phobos#10355 →

Comments

Comment #0 by dhasenan — 2018-10-26T04:32:17Z
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.)
Comment #1 by robert.schadek — 2024-12-01T16:34:22Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10355 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB