www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16684] New: std.getopt, problem with the automatic handling

https://issues.dlang.org/show_bug.cgi?id=16684

          Issue ID: 16684
           Summary: std.getopt, problem with the automatic handling of "h"
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

Compile this program:

===============
void handleH(){assert(false);}
void handleG(){}

void main(string[] args)
{
    import std.getopt;
    getopt(args, config.passThrough, "g", &handleG);
    getopt(args, config.passThrough, "h", &handleH);
}
===============

invoke with the -h option.
An assert error should happen.

There's a problem with the help system. If you replace "h" by "H" and call the
program with -H, then the assertion fails as expected.

--
Nov 14 2016