commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Bug: Error supplying Required Value & Option with same Text

Open Good-man opened this issue 7 years ago • 2 comments

@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.

Good-man avatar Apr 25 '17 14:04 Good-man

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.

JeremyMorton avatar Aug 22 '17 22:08 JeremyMorton

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.

sajagi avatar Oct 05 '17 11:10 sajagi