1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #30473 from albers/completion-plugins-format

Use native call for listing plugins in bash completion
This commit is contained in:
Vincent Demeester 2017-01-27 18:05:07 +01:00 committed by GitHub
commit fa5e0973ec

View file

@ -291,13 +291,13 @@ __docker_complete_plugins_bundled() {
# Set DOCKER_COMPLETION_SHOW_PLUGIN_IDS=yes to also complete IDs.
# For built-in pugins, see `__docker_plugins_bundled`.
__docker_plugins_installed() {
local fields
local format
if [ "$DOCKER_COMPLETION_SHOW_PLUGIN_IDS" = yes ] ; then
fields='$1,$2'
format='{{.ID}} {{.Name}}'
else
fields='$2'
format='{{.Name}}'
fi
__docker_q plugin ls | awk "NR>1 {print $fields}"
__docker_q plugin ls --format "$format"
}
# __docker_complete_plugins_installed applies completion of plugins that were installed