flaggy icon indicating copy to clipboard operation
flaggy copied to clipboard

Process multiple short options with single dash

Open kost opened this issue 4 years ago • 3 comments

If following option is enabled: flaggy.DefaultParser.ProcessMultipleShorts = true

following multiple options : -e -x -a -m -p -l can be written as: -exampl

Since, it breaks previous behaviour, it is added as an option to the parser.

kost avatar Oct 05 '19 11:10 kost

Thanks Kost. I am going to review this tonight - sorry for the delay!

I really appreciate the contribution.

integrii avatar Oct 17 '19 17:10 integrii

We definitely want to get a test or two in here to validate the functionality. I would also like to see more functions and flatter code in this - that's a lot of indents to the right to consider.

I wonder if there is a way to add this functionality by default. I believe POSIX specifies that double dashes -- denotes an upcoming long flag while a single dash - denotes a short flag (or multiple short flags). We could potentially enable this and call it flaggy version 2.0.0.

How would you feel about that?

integrii avatar Oct 18 '19 03:10 integrii

I'm completely fine whatever you decide. Feel free to make it default or not. Also, feel free to flatter the code or test functionality.

kost avatar Oct 26 '19 07:10 kost