customize format

Jan 21, 2009 at 12:15 PM
Edited Jan 21, 2009 at 12:37 PM
could the argument prefix be customized, for example, not "-", but "/"

and for pair, normally it would be /key=value, right now, you use -KeyValue.

btw, how to define switch only option, for example, not -KeyValue, but -Key, no value is needed.

Coordinator
Apr 6, 2009 at 7:02 AM
Hi again,
yes this possible with simple changes to the sources.

I suggest to start hacking the Core/ArgumentParser.cs (ArgumentParser type) source file. Write a unit test that verify your additions and, if it fails, you should take a look also to the core component CommandLineParser type (contained in the omonimous source file).

If you can wait, I will add this option in a future version.

Bye!

Jun 2, 2010 at 4:52 PM

Thanks for creating this library, by the way. It's made things a lot simpler than rolling a custom hack. I second the need for such a prefix but I see the hardcoded nature of this in ArgumentParser. The ideal solution would be to allow not only -, and -- for Unix-like but also / rather than an either/or approach. It seems a bit more complex than adding a couple of || statements so forgive me for being lost. It isn't something I desperately need thankfully but I'd be glad to submit a patch if I thought it were as easy as I think.

 

Regarding unruledboy's comment, a switch only option would be a bool type. You may've updated this since they posted but just calling --option would set it to true.