Skip to content

Commit

Permalink
Add bash completion for docker plugin upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Harald Albers <github@albersweb.de>
  • Loading branch information
albers committed Feb 13, 2017
1 parent 41650df commit 2c52ec8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -3457,6 +3457,7 @@ _docker_plugin() {
push
rm
set
upgrade
"
local aliases="
list
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2c52ec8

Please sign in to comment.