Browse Source

Add missing options to bash completion

Signed-off-by: Harald Albers <github@albersweb.de>
Harald Albers 10 years ago
parent
commit
50eb14244d
1 changed files with 45 additions and 6 deletions
  1. 45 6
      contrib/completion/bash/docker

+ 45 - 6
contrib/completion/bash/docker

@@ -368,7 +368,18 @@ _docker_kill() {
 }
 
 _docker_load() {
-	return
+	case "$prev" in
+		-i|--input)
+			_filedir
+			return
+			;;
+	esac
+
+	case "$cur" in
+		-*)
+			COMPREPLY=( $( compgen -W "-i --input" -- "$cur" ) )
+			;;
+	esac
 }
 
 _docker_login() {
@@ -516,9 +527,11 @@ _docker_run() {
 		--env-file
 		--expose
 		-h --hostname
+		--ipc
 		--link
 		--lxc-conf
 		-m --memory
+		--mac-address
 		--name
 		--net
 		-p --publish
@@ -577,6 +590,21 @@ _docker_run() {
 			compopt -o nospace
 			return
 			;;
+		--ipc)
+			case "$cur" in
+				*:*)
+					cur="${cur#*:}"
+					__docker_containers_running
+					;;
+				*)
+					COMPREPLY=( $( compgen -W 'host container:' -- "$cur" ) )
+					if [ "$COMPREPLY" = "container:" ]; then
+						compopt -o nospace
+					fi
+					;;
+			esac
+			return
+			;;
 		--link)
 			case "$cur" in
 				*:*)
@@ -644,7 +672,7 @@ _docker_run() {
 			esac
 			return
 			;;
-		--entrypoint|-h|--hostname|-m|--memory|-u|--user|-w|--workdir|--cpuset|-c|--cpu-shares|-n|--name|-p|--publish|--expose|--dns|--lxc-conf|--dns-search)
+		--entrypoint|-h|--hostname|--mac-address|-m|--memory|-u|--user|-w|--workdir|--cpuset|-c|--cpu-shares|-n|--name|-p|--publish|--expose|--dns|--lxc-conf|--dns-search)
 			return
 			;;
 	esac
@@ -664,10 +692,21 @@ _docker_run() {
 }
 
 _docker_save() {
-	local counter=$(__docker_pos_first_nonflag)
-	if [ $cword -eq $counter ]; then
-		__docker_image_repos_and_tags_and_ids
-	fi
+	case "$prev" in
+		-o|--output)
+			_filedir
+			return
+			;;
+	esac
+
+	case "$cur" in
+		-*)
+			COMPREPLY=( $( compgen -W "-o --output" -- "$cur" ) )
+			;;
+		*)
+			__docker_image_repos_and_tags_and_ids
+			;;
+	esac
 }
 
 _docker_search() {