[Issue 19362] New: std.getopt.config: change type to disallow or support bitwise operands

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 3 18:37:33 UTC 2018


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

--


More information about the Digitalmars-d-bugs mailing list