From d5cdbdc734f4092992b3f88b3585438b9eed80ab Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Wed, 19 Oct 2016 18:24:24 +0200 Subject: [PATCH] Move bash completion logic to new subcommand: attach Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 1210620683..1b84f45f09 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -821,19 +821,7 @@ _docker_docker() { } _docker_attach() { - __docker_complete_detach-keys && return - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W "--detach-keys --help --no-stdin --sig-proxy=false" -- "$cur" ) ) - ;; - *) - local counter=$(__docker_pos_first_nonflag '--detach-keys') - if [ $cword -eq $counter ]; then - __docker_complete_containers_running - fi - ;; - esac + _docker_container_attach } _docker_build() { @@ -950,7 +938,19 @@ _docker_container() { } _docker_container_attach() { - _docker_attach + __docker_complete_detach-keys && return + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--detach-keys --help --no-stdin --sig-proxy=false" -- "$cur" ) ) + ;; + *) + local counter=$(__docker_pos_first_nonflag '--detach-keys') + if [ $cword -eq $counter ]; then + __docker_complete_containers_running + fi + ;; + esac } _docker_container_commit() {