Skip to content
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

Multi-instance option not supported #899

Open
RomanSoloweow opened this issue Aug 24, 2023 · 2 comments
Open

Multi-instance option not supported #899

RomanSoloweow opened this issue Aug 24, 2023 · 2 comments

Comments

@RomanSoloweow
Copy link

RomanSoloweow commented Aug 24, 2023

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
Copy link
Author

RomanSoloweow commented Aug 24, 2023

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

@wilbit
Copy link

wilbit commented Nov 16, 2023

This duplicates #357 , and fixed by #678

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

No branches or pull requests

2 participants