Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process multiple short options with single dash #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kost
Copy link

@kost kost commented Oct 5, 2019

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.

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.
@integrii
Copy link
Owner

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

I really appreciate the contribution.

@integrii
Copy link
Owner

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?

@kost
Copy link
Author

kost commented Oct 26, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants