diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 095c00732b..b282d984dd 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1263,7 +1263,20 @@ _docker_container_rename() { } _docker_container_restart() { - _docker_restart + case "$prev" in + --time|-t) + return + ;; + esac + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--help --time -t" -- "$cur" ) ) + ;; + *) + __docker_complete_containers_all + ;; + esac } _docker_container_rm() { @@ -2521,20 +2534,7 @@ _docker_rename() { } _docker_restart() { - case "$prev" in - --time|-t) - return - ;; - esac - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W "--help --time -t" -- "$cur" ) ) - ;; - *) - __docker_complete_containers_all - ;; - esac + _docker_container_restart } _docker_rm() {