From f2aab003216837a57220098b7f401fdf148b5282 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Wed, 8 Feb 2017 13:40:13 +0100 Subject: [PATCH] Add bash completion for `docker plugin upgrade` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 8d306437ca..b60a4c9fa5 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -3457,6 +3457,7 @@ _docker_plugin() { push rm set + upgrade " local aliases=" list @@ -3634,6 +3635,25 @@ _docker_plugin_set() { esac } +_docker_plugin_upgrade() { + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--disable-content-trust --grant-all-permissions --help --skip-remote-check" -- "$cur" ) ) + ;; + *) + local counter=$(__docker_pos_first_nonflag) + if [ $cword -eq $counter ]; then + __docker_complete_plugins_installed + __ltrim_colon_completions "$cur" + elif [ $cword -eq $((counter + 1)) ]; then + local plugin_images="$(__docker_plugins_installed)" + COMPREPLY=( $(compgen -S : -W "${plugin_images%:*}" -- "$cur") ) + __docker_nospace + fi + ;; + esac +} + _docker_port() { _docker_container_port