Thanks for the awesome library, I've been using it for years.
Just wondering if you're interested in supporting standard GNU getopt() syntax? This is the one thing I feel this project could benefit from. At the moment it's just an idea, though I'd be happy to do the work and send a PR if you agree. A quick google for "golang getopt" shows a number of existing implementations, so it should just be a matter of picking one of those and hooking it in appropriately?
FYI, the end-user impact of this would be as follows. Say you have the following flag definitions:
cli.IntFlag{
Name: "n",
Usage: "max number of things",
},
cli.BoolFlag{
Name: "quiet, q",
Usage: "Reduces the text output",
},
cli.BoolFlag{
Name: "all, a",
Usage: "show deleted stuff too",
},
then currently the CLI user has to type:
-a -q -n 1
but getopt() allows you to type:
-aqn1
Hey Dan @meatballhat, I opened this issue really just to get some initial feedback. As I said, I'd be happy to submit a PR if you like the idea.
Hi @boyvinall I'd be happy to review a PR for this, if you're still interested!
Hi @lynncyrin, will see if I get some time but things are fairly busy. I've thought about this a bit more since opening it though .. I realised that the long flag name form is currently accepted with either a single or double dash (--flag or -flag) which would conflict with this. So if this issue is resolved then I guess, for backwards compatibility, it would need to be conditionally enabled. Your thoughts on that?
Isn't this solved on master? You have to single dash for short opt expansion (which is standard) in this library I believe.
So if this issue is resolved then I guess, for backwards compatibility, it would need to be conditionally enabled. Your thoughts on that?
I believe this is what the UseShortOptionHandling option does? Please correct me if that's wrong!
This has been sitting idle for a while, so I'll circle back and close it soon - unless someone wants to keep it open!
Sorry for going quiet. Yeah, I hadn't noticed UseShortOptionHandling, that looks like the thing, thanks.