fix: remove asterisk from docker command suggestions #3540
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #3631
- What I did
Some commands in the output of
dockershow up with an asterisk, likeapp,build,buildxorscan.This tweak removes them so that the asterisk is not filled in when choosing those commands.
- How I did it
In
__docker_commands, the output ofdockeris parsed to get the list of valid commands. The function already trims whitespace from left and right. I just added a zsh-regex pattern for an asterisk on the right-hand side to remove it as well.The zsh regex
\*#is equivalent to POSIX regex\**(0 or more occurrences of*) (note that this requiressetopt extendedglob).- How to verify it
cdinto the project root.unfunction _dockerif docker completion has been attempted before.autoload -Uz $PWD/contrib/completion/zsh/_docker.docker.Suggestion entries should appear without a trailing asterisk:
- Description for the changelog
Remove trailing asterisk from zsh completion for docker commands.
- A picture of a cute animal (not mandatory but encouraged)