Bug 13315 – std.getopt: implicit help option doesn't work without config.passThrough

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

Comments

Comment #0 by nilsbossung — 2014-08-17T22:10:33Z
--- cat > test.d << code import std.getopt; void main() { string[] args = ["program", "--help"]; auto r = getopt(args); assert(r.helpWanted); } code dmd test.d ./test --- std.getopt.GetOptException@/home/nils/d/dmd/dmd2/linux/bin64/../../src/phobos/std/getopt.d(597): Unrecognized option --help --- The documentation doesn't say that the implicit help option only works with config.passThrough. The examples that use helpWanted don't use config.passThrough. Pull request is on the way.
Comment #1 by nilsbossung — 2014-08-17T22:13:10Z
Comment #2 by github-bugzilla — 2014-08-18T16:51:55Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d51af72d5a0a999b62d26f9973e5a2cb8ea5041f fix Issue 13315 - std.getopt: implicit help option doesn't work without config.passThrough https://github.com/D-Programming-Language/phobos/commit/a2b4b0eadede01836cab4f3418131d6095ae9c4c Merge pull request #2433 from NilsBossung/13315 fix issues 13315, 13316, 13317 - std.getopt woes