DockerCLI/contrib/completion
Marc Cornellà f617883fdf
Fix docker plugin suggestions in Zsh completion
The __docker_plugins function calls `docker plugin ls` to get its information,
but it doesn't output a TAG column anymore. Without this change, triggering
the function, e.g. trying to complete `docker plugin inspect`, produces the
following error repeatedly:

  __docker_plugins:27: bad math expression: empty string

Also, the tag part of the docker plugin is shown in the NAME column, but the
colon (:) character is swallowed by the `_describe` function and interpreted
so that the right-side of the string is displayed as a comment to the suggestion.
For example: vieux/sshfs:latest is suggested like

  vieux/sshfs    -- latest

instead of the tag being part of the suggestion. This means that if there are
more than one tags installed of the same docker plugin, they are both combined
into a single completion entry, instead of two, one for each tag. By quoting
the colon character, the tag is now correctly offered in the suggestion.

With this commit the plugin description is added to each completion suggestion
and plugin names are shown without the redundant ":latest" tag.

Fixes #9294

Signed-off-by: Marc Cornellà <hello@mcornella.com>
2022-04-06 19:39:05 +02:00
..
bash cli/command: Add quiet option for create and run 2022-03-01 14:20:18 +01:00
fish tweak description of login/logout 2022-04-04 10:44:11 +02:00
powershell Add link to DockerCompletion for PowerShell 2017-09-29 17:04:33 +09:00
zsh Fix docker plugin suggestions in Zsh completion 2022-04-06 19:39:05 +02:00