[Issue 23909] New: std.getopt stopOnFirstNonOption ignored with switches
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue May 9 10:04:09 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23909
Issue ID: 23909
Summary: std.getopt stopOnFirstNonOption ignored with switches
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: dlang-bugzilla at thecybershadow.net
It tries to parse the switch (and throws "Can't parse string"), even though
there is a non-option argument before it:
/////////////////// test.d ///////////////////
import std.getopt;
void main()
{
string[] args = ["program", "dmd", "-de"];
bool doDownload;
getopt(args,
"d", &doDownload,
config.stopOnFirstNonOption,
);
}
//////////////////////////////////////////////
Introduced in https://github.com/dlang/phobos/pull/1050
--
More information about the Digitalmars-d-bugs
mailing list