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

Fix #628: Bash completion for nested commands broken #639

Closed
wants to merge 1 commit into from

Conversation

@pgkelley4
Copy link
Contributor

commented Aug 19, 2016

When concatenating protected_args and args, protected_args
should be prepended. Otherwise the arguments are out
of order and an incorrect subcommand is choosen.

@pgkelley4

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2016

This is the same fix as xificurC did here: #630, but with added unit tests to demonstrate the issue.

When concatenating protected_args and args, protected_args
should be prepended. Otherwise the arguments are out
of order and an incorrect subcommand is choosen.
pass

assert list(get_choices(cli, 'lol', [], '-')) == ['--local-opt']
assert list(get_choices(cli, 'lol', [], '')) == []

This comment has been minimized.

Copy link
@untitaker

untitaker Aug 19, 2016

Member

This test doesn't fail if I revert the fix though.

This comment has been minimized.

Copy link
@pgkelley4

pgkelley4 Aug 19, 2016

Author Contributor

The other one: 'def test_long_chain():' does. I just added the test_single_command for completeness. See my comment here: #628 (comment)

@untitaker untitaker self-assigned this Aug 19, 2016
@pgkelley4 pgkelley4 force-pushed the pgkelley4:master branch from eec31e3 to b7ae2a8 Aug 19, 2016
@pgkelley4 pgkelley4 changed the title Fix #630: Bash completion for nested commands broken Fix #628: Bash completion for nested commands broken Aug 19, 2016
@untitaker untitaker closed this in 891a223 Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.