fclp / fluent-command-line-parser

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

The documentation does not provide a usage example for CaptureAdditionalArguments. #73

Open J8K3-zz opened 8 years ago

J8K3-zz commented 8 years ago

The documentation does not provide a usage example for CaptureAdditionalArguments. Can I request a quick usage example?

siywilliams commented 7 years ago

@J8K3 It took me a while to remember what that option was for as I've actually never really used it.

From the looks of it thought it was intended to give you the ability to capture any extra values found for an option that clearly is only inteded for one. For example, exposing the ability to specify a maximum value via the cmd line would like like this:

fclp.Setup<int>("max-value");

but if the user enters this in the cmd line app.exe --max-value 1 2 3 then the value 1 will be assigned to the callback, but what to do with values 2 and 3? Using the CaptureAdditionalArguments would allow the consumer the option of doing something.

It might be better for the parser to throw an exception if it has multiple values assigned to a single value option.

Anyway, I hope that helps, even if it is 14 months too late.