瀏覽代碼

Merge pull request #15229 from albers/completion-inspect-filter-by-type

Filter completions of `docker inspect` by `--type`
David Calavera 10 年之前
父節點
當前提交
137995cb94
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      contrib/completion/bash/docker

+ 11 - 2
contrib/completion/bash/docker

@@ -738,8 +738,17 @@ _docker_inspect() {
 			COMPREPLY=( $( compgen -W "--format -f --type --help" -- "$cur" ) )
 			;;
 		*)
-			__docker_containers_and_images
-			;;
+			case $(__docker_value_of_option --type) in
+				'')
+					__docker_containers_and_images
+					;;
+				container)
+					__docker_containers_all
+					;;
+				image)
+					__docker_image_repos_and_tags_and_ids
+					;;
+			esac
 	esac
 }