Tyrrrz / CliFx

Class-first framework for building command-line interfaces
MIT License
1.48k stars 60 forks source link

Pass-through arguments #39

Open Tyrrrz opened 4 years ago

Tyrrrz commented 4 years ago

Add support for path-through arguments.

Sometimes the application may act as a proxy to another application. An example of this is dotnet run which routes any arguments after -- directly to the executed application.

Example:

dotnet run -c Release -- arg1 arg2 --flag

Arguments arg1, arg2, --flag are passed as is to the executed application.

Allow [CommandArgumentSink] attribute on properties of type IEnumerable<string> or any other type that can be assigned from a string array or initialized with a string array (similar to how we do conversions currently). There can only be one such property.

Note: this has to play nicely with #38.

Open question:

drewburlingame commented 4 years ago

Hiya, I found your tool from a reference and hadn't seen it before. I've been contributing to CommandDotNet. We implemented pass-through. Well, we had pass-through but realized I'd forgotten about the end-of-options feature which was the original reason -- was introduced.

If you're not aware of it, this may be interesting reading

This allows users to specify argument values that look like options, like Add -1 -2 or something that starts with --. We had to do some work to back-fit it so I thought I'd bring this up in case you weren't aware.

Tyrrrz commented 4 years ago

Yep, I'm aware. Thanks!