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

Support combined short options from user input #4

Open
clue opened this issue Oct 12, 2016 · 1 comment
Open

Support combined short options from user input #4

clue opened this issue Oct 12, 2016 · 1 comment

Comments

@clue
Copy link
Owner

clue commented Oct 12, 2016

We should support matching combined short options:

add [-i] [-a] [-d=<X>] [-w=<X>]

All add -i -a, add -ia and add -ai should result in the same match.

Also, short options with values (depends on #3) may be even trickier.

Depends on #2.

@clue
Copy link
Owner Author

clue commented Nov 5, 2016

For the reference: This ticket hasn't seen any progress because it's actually quite tricky. Its syntax does in fact collide with concatenated values for short options as implemented in #12.

add -iwa should be interpreted as add -i -w=a and not as add -i -w -a.

This means that we can only consume combined short options beginning from the first letter and then checking each occurrence if it accepts a value.

This change will likely require a major refactoring, because we currently consume individual tokens from the route expression the order they're defined in. We may now have to also check combined options in the order they're passed in.

@clue clue changed the title Support combined short options Support combined short options from user input Apr 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant