D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7693 - Getopt Ignores Trailing Characters on Enums
Summary: Getopt Ignores Trailing Characters on Enums
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2012-03-12 10:46 UTC by David Simcha
Modified: 2014-03-24 10:36 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2012-03-12 10:46:32 UTC
import std.stdio, std.getopt;

enum Foo {
    bar,
    baz
}

void main(string[] args) {
    Foo foo;
    getopt(args, "foo", &foo);
    writeln(foo);
}

$ dmd test.d
$ ./test --foo barThatIDrinkAt
bar