Browse Source

Move bash completion logic to new subcommand: stats

Signed-off-by: Harald Albers <github@albersweb.de>
Harald Albers 8 years ago
parent
commit
19f31f8e48
1 changed files with 15 additions and 15 deletions
  1. 15 15
      contrib/completion/bash/docker

+ 15 - 15
contrib/completion/bash/docker

@@ -1595,7 +1595,20 @@ _docker_container_start() {
 }
 }
 
 
 _docker_container_stats() {
 _docker_container_stats() {
-	_docker_stats
+	case "$prev" in
+		--format)
+			return
+			;;
+	esac
+
+	case "$cur" in
+		-*)
+			COMPREPLY=( $( compgen -W "--all -a --format --help --no-stream" -- "$cur" ) )
+			;;
+		*)
+			__docker_complete_containers_running
+			;;
+	esac
 }
 }
 
 
 _docker_container_stop() {
 _docker_container_stop() {
@@ -2913,20 +2926,7 @@ _docker_start() {
 }
 }
 
 
 _docker_stats() {
 _docker_stats() {
-	case "$prev" in
-		--format)
-			return
-			;;
-	esac
-
-	case "$cur" in
-		-*)
-			COMPREPLY=( $( compgen -W "--all -a --format --help --no-stream" -- "$cur" ) )
-			;;
-		*)
-			__docker_complete_containers_running
-			;;
-	esac
+	_docker_container_stats
 }
 }
 
 
 _docker_stop() {
 _docker_stop() {