Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/completion/zsh/_docker
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ __docker_plugins() {
# Name
for line in $lines; do
s="${line[${begin[NAME]},${end[NAME]}]%% ##}"
s="$s:${(l:7:: :::)${${line[${begin[TAG]},${end[TAG]}]}%% ##}}"
s="$s:${(r:7:: :::)${${line[${begin[ID]},${end[ID]}]}%% ##}}"
Comment on lines 1576 to +1578

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps instead, it should use --format to get the right fields, e.g.;

docker plugin ls --format='{{.ID}}\t{{.Name}}'
e91da965f5d9	vieux/sshfs:latest

FWIW; we mostly consider these hand-written completion script in "maintenance" mode, as the CLI now provide dynamically generated completion;

docker completion --help
Usage:  docker completion COMMAND

Generate the autocompletion script for docker for the specified shell.
See each sub-command's help for details on how to use the generated script.

Commands:
  bash        Generate the autocompletion script for bash
  fish        Generate the autocompletion script for fish
  powershell  Generate the autocompletion script for powershell
  zsh         Generate the autocompletion script for zsh

Run 'docker completion COMMAND --help' for more information on a command.

plugins=($plugins $s)
done

Expand Down