From 509d2cc9b662c72091e9fc664f83e17921ef54db Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Mon, 24 Oct 2016 09:27:44 -0700 Subject: [PATCH] Move bash completion logic to new subcommand: push 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 681a35191d..ca0570d629 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2175,7 +2175,17 @@ _docker_image_pull() { } _docker_image_push() { - _docker_push + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--disable-content-trust=false --help" -- "$cur" ) ) + ;; + *) + local counter=$(__docker_pos_first_nonflag) + if [ $cword -eq $counter ]; then + __docker_complete_image_repos_and_tags + fi + ;; + esac } _docker_image_remove() { @@ -3032,17 +3042,7 @@ _docker_pull() { } _docker_push() { - case "$cur" in - -*) - COMPREPLY=( $( compgen -W "--disable-content-trust=false --help" -- "$cur" ) ) - ;; - *) - local counter=$(__docker_pos_first_nonflag) - if [ $cword -eq $counter ]; then - __docker_complete_image_repos_and_tags - fi - ;; - esac + _docker_image_push } _docker_rename() {