From 04886bca2f58bda0253bb0e88149e45625663670 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Thu, 20 Oct 2016 09:13:06 +0200 Subject: [PATCH] Move bash completion logic to new subcommand: stats Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 487e71c96b..bdafee5a43 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1595,7 +1595,20 @@ _docker_container_start() { } _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() { @@ -2913,20 +2926,7 @@ _docker_start() { } _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() {