Skip to content

completions: only complete --options when a leading - has been entered #1638

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

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

Conversation

exploide
Copy link

  • I have added a news fragment under changelog.d/ (if the patch affects the end users)

Summary of changes

pipx uses argcomplete for generating shell completions. By default, argcomplete shows --option completions even if no leading - has been entered.
I consider this unusual and it doesn't look cleanly. Other autocompletion engines I know behave differently.

Therefore, I propose to set the always_complete_options=False parameter, which shows --options only when a leading - has already been entered.

Feel free to reject if you like the current behavior more, but I thought I will propose the change since the configuration parameter might have been unknown.

Test plan

Before, subcommands and options are intermixed:
before

After this change, it is more clean and conforms to the usual behavior:
after-commands
after-options

@exploide exploide force-pushed the argcomplete-options branch from 9f6ce96 to 4b665a7 Compare May 17, 2025 13:42
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.

1 participant