[Issue 17945] New: defaultGetoptPrinter prints options with multiple names wrong

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 28 16:02:06 UTC 2017


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

          Issue ID: 17945
           Summary: defaultGetoptPrinter prints options with multiple
                    names wrong
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: zorael at gmail.com

import std.getopt;

void main(string[] args)
{
    bool verbose;
    auto helpInformation = std.getopt.getopt(args,
        "verbose|loquacious|garrulous", "(description)", &verbose);  // from
the doc example

    defaultGetoptPrinter("asdf", helpInformation.options);
}


The displayed help line for &verbose is:
    -verbose --loquacious (description)

-verbose is wrong as it should have two dashes.
    std.getopt.GetOptException@/usr/include/dlang/dmd/std/getopt.d(789):
Unrecognized option -verbose

--garrulous is properly accepted but missing from the help page.

--


More information about the Digitalmars-d-bugs mailing list