-
Notifications
You must be signed in to change notification settings - Fork 481
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
MissingRequiredOptionError when specifying required Value after enumerable Options #91
Comments
Yes, I think that's a bug. If you set void Main()
{
var p = new Parser(s =>
{
s.EnableDashDash = true;
});
var result = p.ParseArguments<CommandLineOptions>("--exclude=a,b -- InputFile.txt".Split());
result.WithNotParsed(e => e.Dump());
result.WithParsed(d => d.Dump());
}
public class CommandLineOptions
{
[Value(0, Required = true)]
public string InputFileName { get; set; }
[Option('o', "output")]
public string OutputFileName { get; set; }
[Option('i', "include", Separator = ',')]
public IEnumerable<string> Included { get; set; }
[Option('e', "exclude", Separator = ',')]
public IEnumerable<string> Excluded { get; set; }
} |
As a workaround, the commandline |
This appears to be fixed in the master branch, @SuperFXMaster and @nemec . I cannot reproduce the issue. Please let me know if I am incorrect. |
I'm still having issues on the master branch with the code snippet I posted above, as well as @SuperFXMaster's. |
Had quick look into this and could let the example above to run by changing the order of parameters in Concat in the following line: I'm not sure it's valid for other cases though. Maybe someone who knows more about it can have a look. It would be nice to get a stable version. |
This will be fixed by #684 once it's merged in. |
Tuesday Oct 11, 2016 at 19:24 GMT
Originally opened as gsscoder/commandline#361
The following options class:
When provided to the default parser, with the commandline
app.exe --exclude=a,b InputFile.txt
results in aMissingRequiredOptionError: A required value not bound to option name is missing
. I expected the library to acceptInputFileName = InputFile.txt
and--exclude=a,b
asExcluded = { "a", "b" }
. Is there something else required to make this work as I expect, or is it a bug?The text was updated successfully, but these errors were encountered: