commandline
commandline copied to clipboard
Multi-instance option not supported
public class Arguments
{
[Option("arg1", Required = true)]
public string Arg1 { get; set; }
[Option("arg2", Required = true)]
public IEnumerable<string> Arg2 { get; set; }
}
When i call:
// In console: --arg1=test --arg2=Value1 --arg2=Value2
var args = new [] { "--arg1=test", "--arg2=Value1", "--arg2=Value2" };
var arguments = Parser.Default.ParseArguments<Arguments>(args)
I have RepeatedOptionError
It's fixed if set "AllowMultiInstance" flag:
var parser = new Parser(settings =>
{
settings.AllowMultiInstance = true;
settings.EnableDashDash = true;
});
But I discovered it by accident. Worth adding to the documentation
This duplicates #357 , and fixed by #678