Bug 13317 – std.getopt: endOfOptions broken when it doesn't look like an option

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-17T23:13:00Z
Last change time
2014-08-18T16:51:59Z
Assigned to
nobody
Creator
nilsbossung

Comments

Comment #0 by nilsbossung — 2014-08-17T23:13:19Z
--- cat > test.d << code import std.getopt; void main() { std.getopt.endOfOptions = "endofoptions"; string[] args = ["program", "endofoptions", "--option"]; bool b = false; getopt(args, "option", &b); assert(!b); assert(args == ["program", "--option"]); } code dmd test.d ./test --- std.getopt.GetOptException@/home/nils/d/dmd/dmd2/linux/bin64/../../src/phobos/std/getopt.d(597): Unrecognized option --option --- Going to add the fix for this to the pull request I have open for 13315 and 13316: https://github.com/D-Programming-Language/phobos/pull/2433
Comment #1 by github-bugzilla — 2014-08-18T16:51:58Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/c40fd397c6d3ec2bc1533e0016eb9b04b5ef6bdb fix Issue 13317 - std.getopt: endOfOptions broken when it doesn't look like an option https://github.com/D-Programming-Language/phobos/commit/a2b4b0eadede01836cab4f3418131d6095ae9c4c Merge pull request #2433 from NilsBossung/13315 fix issues 13315, 13316, 13317 - std.getopt woes