www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13317] New: std.getopt: endOfOptions broken when it doesn't


          Issue ID: 13317
           Summary: std.getopt: endOfOptions broken when it doesn't look
                    like an option
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: nilsbossung googlemail.com

cat > test.d << code
import std.getopt;
void main()
    std.getopt.endOfOptions = "endofoptions";
    string[] args = ["program", "endofoptions", "--option"];
    bool b = false;
    getopt(args, "option", &b);
    assert(args == ["program", "--option"]);
dmd test.d
std.getopt.GetOptException /home/nils/d/dmd/dmd2/linux/bin64/../../src/phobos/std/getopt.d(597):
Unrecognized option --option

Going to add the fix for this to the pull request I have open for 13315 and
13316: https://github.com/D-Programming-Language/phobos/pull/2433

Aug 17 2014