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.