www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19362] New: std.getopt.config: change type to disallow or

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

          Issue ID: 19362
           Summary: std.getopt.config: change type to disallow or support
                    bitwise operands
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: dhasenan gmail.com

Test case:
---
unittest
{
  import std.getopt;
  auto args = ["exe", "-h"];
  int intFlag = 5;
  auto result = getopt(args, config.caseSensitive | config.bundling, "H",
&intFlag);
  assert(intFlag == 5);
  assert(result.helpWanted);
}
---

It's normal with logically composable enums to be able to or them together.
This doesn't work for std.getopt. If it compiles, it should do the right thing.

--
Nov 03 2018