Skip to content

Commit

Permalink
Merge pull request moby#30823 from albers/completion-plugin-upgrade
Browse files Browse the repository at this point in the history
Add bash completion for `docker plugin upgrade`
  • Loading branch information
mlaventure committed Feb 13, 2017
2 parents ca3f827 + 2c52ec8 commit c9fa3ee
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 c9fa3ee

Please sign in to comment.