Closed ericjohannsen closed 8 years ago
:+1:
How do you expect to be able to consume these unmatched arguments in your code?
Also, you can already do something like this:
[ArgIgnore]
public string FooArgument{get;set;}
On Thu, Oct 8, 2015 at 11:28 AM, Adam Abdelhamed notifications@github.com wrote:
How do you expect to be able to consume these unmatched arguments in your code?
I don't want to consume them at all, that is the point.
I want to be able to specify an argument that is completely ignored by the argument parser.
That is the opposite of [ArgIgnore].
The reason is that I often find myself typing in lengthy arguments while in the develop/test cycle. Visual Studio has a properties box where I can enter my arguments. Rather than delete a lengthy argument only to type it in again next time I need it, I just change the name of the argument to something meaningless (e.g. by prepending xxx). Prior to adopting PowerArgs that worked fine. My prevous argument parser would just ignore arguments that it did not understand.
I don't see any valid purpose for this for released code, but it would be pretty handy during development.
Eric
I just checked this in directly into the master branch. I'll publish it sometime this weekend.
Thank you, this change is very helpful.
You're welcome
When developing in Visual Studio, I often write a number of command line arguments that I'm testing or use frequently into the project Properties / Debug / Start Options, e.g.
/file:C:\Some\Long\Path /pre:12345678
When I don't want a particular option for a particular execution, I just change the parameter name
/XXXfile:C:\Some\Long\Path /pre:12345678
Unfortunately, and apparently by design, any unrecognized argument causes PowerArgs to throw an Exception.
It would be nice there were a class level attribute to control this behavior. That would allow for e.g.
if DEBUG
[ArgIgnoreUnmatchedArguments]
endif
public class MyArgs