瀏覽代碼

Add bash completion for `docker plugin upgrade`

Signed-off-by: Harald Albers <github@albersweb.de>
Harald Albers 8 年之前
父節點
當前提交
2c52ec8403
共有 1 個文件被更改,包括 20 次插入0 次删除
  1. 20 0
      contrib/completion/bash/docker

+ 20 - 0
contrib/completion/bash/docker

@@ -3457,6 +3457,7 @@ _docker_plugin() {
 		push
 		push
 		rm
 		rm
 		set
 		set
+		upgrade
 	"
 	"
 	local aliases="
 	local aliases="
 		list
 		list
@@ -3634,6 +3635,25 @@ _docker_plugin_set() {
 	esac
 	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_port() {
 	_docker_container_port
 	_docker_container_port