commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Multi-instance option not supported

Open RomanSoloweow opened this issue 2 years ago • 2 comments

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

RomanSoloweow avatar Aug 24 '23 08:08 RomanSoloweow

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

RomanSoloweow avatar Aug 24 '23 08:08 RomanSoloweow

This duplicates #357 , and fixed by #678

wilbit avatar Nov 16 '23 21:11 wilbit