From f533df0821fcb3ac741f82bdb18529fc26402b28 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Thu, 20 Oct 2016 08:50:04 +0200 Subject: [PATCH] Move bash completion logic to new subcommand: port Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 8147c974ad..095c00732b 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1249,7 +1249,17 @@ _docker_container_ps() { } _docker_container_rename() { - _docker_rename + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) + ;; + *) + local counter=$(__docker_pos_first_nonflag) + if [ $cword -eq $counter ]; then + __docker_complete_containers_all + fi + ;; + esac } _docker_container_restart() { @@ -2507,17 +2517,7 @@ _docker_push() { } _docker_rename() { - case "$cur" in - -*) - COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) - ;; - *) - local counter=$(__docker_pos_first_nonflag) - if [ $cword -eq $counter ]; then - __docker_complete_containers_all - fi - ;; - esac + _docker_container_rename } _docker_restart() {