Skip to content

Bug: Error supplying Required Value & Option with same Text #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericnewton76 opened this issue Nov 4, 2017 · 3 comments
Closed

Bug: Error supplying Required Value & Option with same Text #133

ericnewton76 opened this issue Nov 4, 2017 · 3 comments
Labels

Comments

@ericnewton76
Copy link
Member

Issue by Good-man
Tuesday Apr 25, 2017 at 14:54 GMT
Originally opened as gsscoder/commandline#440


@gsscoder

Given:

class Options
{
    [Value(0, Required = true)]
    public string Text { get; set; }

    [Option("option", Required = true)]
    public string Option { get; set; }
}

mycmd.exe "test" --option "test"

produces:

ERROR(S):
  A required value not bound to option name is missing.

  --option        Required.

  --help          Display this help screen.

  --version       Display version information.

  value pos. 0    Required.

whereas

mycmd.exe "test1" --option "test2"

works fine.

It's not apparent why passing the same value would cause commandline to behave differently.

@ericnewton76
Copy link
Member Author

Comment by JeremyMorton
Tuesday Aug 22, 2017 at 22:38 GMT


This is especially common when you have integer options and values, since it can be common to want to specify 0 or 1 for both an option and a value.

@ericnewton76
Copy link
Member Author

Comment by sajagi
Thursday Oct 05, 2017 at 11:58 GMT


This bug is still present in the latest nuget package (2.1.1-beta), but it looks like it's fixed already in source code.

@moh-hassan
Copy link
Collaborator

Resolved.
Try it online

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants