fclp / fluent-command-line-parser

A simple, strongly typed .NET C# command line parser library using a fluent easy to use interface
Other
530 stars 85 forks source link

Repeated arguments are ignored. Only the first one is used #94

Open ghost opened 6 years ago

ghost commented 6 years ago

I'm invoking my program like this: program.exe -p param1 -p param2 -p ...

with the following declaration:
IList<string> parameters = new List<string>();
var parser = new FluentCommandLineParser();
parser.Setup<string>('p').Callback(p => parameters.Add(p));
parser.Parse(args);

At the end of the call to Parse() I only have "param1" in my collection

siywilliams commented 6 years ago

Hi Jeff,

Yes I must admit I never thought of that use case. You can however use program.exe -p param1 param2 ... to achieve the same thing

Simon

On 29 Jan 2018 21:52, "Jeff Saremi" notifications@github.com wrote:

I'm invoking my program like this: program.exe -p param1 -p param2 -p ...

with the following declaration: IList parameters = new List(); var parser = new FluentCommandLineParser(); parser.Setup('p').Callback(p => parameters.Add(p)); parser.Parse(args);

At the end of the call to Parse() I only have "param1" in my collection

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fclp/fluent-command-line-parser/issues/94, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfmmapgcJI9AvPprXl8HMI2UnPp3IwYks5tPj2egaJpZM4RxaiE .