[Issue 16684] New: std.getopt, problem with the automatic handling of "h"

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Nov 14 04:21:51 PST 2016


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 at puremagic.com
          Reporter: b2.temp at 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.

--


More information about the Digitalmars-d-bugs mailing list