Bug 23909 – std.getopt stopOnFirstNonOption ignored with switches

Status
RESOLVED
Resolution
INVALID
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-05-09T10:04:09Z
Last change time
2023-05-09T10:15:56Z
Assigned to
No Owner
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2023-05-09T10:04:09Z
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
Comment #1 by dlang-bugzilla — 2023-05-09T10:15:56Z
Oh, configuration is positional. Invalid.