I’ve been using cmdargs for argument processing for a while, and it’s great. However, I don’t see a facility for long option names with a single hyphen, e.g. -option1 -option2 or the more difficult -optx which is equivalent to --opt=x. I need to maintain compatibility with an existing application, so these formats are both necessary.
System.Console.Getopt doesn’t seem up to it either. Can anyone either provide a sample of how to do this with cmdargs, or suggest an alternative library which will support this?
Probably the simplest thing you can do is to do a quick pre-processing pass yourself. For example, if you need to support exactly the three options
-option1,-option2, and-optx, Something like this should work:As you say, though, the help messages would then no longer mention the possibility of having these short forms. (Perhaps that’s a good thing, though.)
If you want more, you will probably have to convince somebody to modify cmdargs.