www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17945] New: defaultGetoptPrinter prints options with multiple

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 puremagic.com
          Reporter: zorael 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.

--
Oct 28