Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix issue #275 #276

Merged
merged 3 commits into from
Sep 27, 2018
Merged

Fix issue #275 #276

merged 3 commits into from
Sep 27, 2018

Conversation

chipaca
Copy link
Contributor

@chipaca chipaca commented Sep 26, 2018

This change restores the old behaviour of PassAfterNonOption working
together with commands so that a command would (also) get everything
after the first non-option, while also preserving the new behaviour of
those non-options landing in the positional array if provided.

The behaviour for when a command and a positional array are both
present continues to be weird (but it's unclear whether there's a
non-weird way out of that one other than failing with a "don't do
that").

This change restores the old behaviour of PassAfterNonOption working
together with commands so that a command would (also) get everything
after the first non-option, while also preserving the new behaviour of
those non-options landing in the positional array if provided.

The behaviour for when a command and a positional array are both
present continues to be weird (but it's unclear whether there's a
non-weird way out of that one other than failing with a "don't do
that").
@chipaca
Copy link
Contributor Author

chipaca commented Sep 26, 2018

To be clear, the weird behaviour with commands + positional happens if they're at the same level—I added a test to check for a command that had a positional array, as that one works fine and is clear.

Copy link
Owner

@jessevdk jessevdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Could you move the additional tests to command_test.go?

@chipaca
Copy link
Contributor Author

chipaca commented Sep 27, 2018 via email

@jessevdk jessevdk merged commit 7309ec7 into jessevdk:master Sep 27, 2018
@chipaca chipaca deleted the fix-275 branch October 1, 2018 08:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants