From d1ed8008606d4cee46a4e24a87e61235bd61cc38 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Mon, 21 Aug 2017 14:50:46 +0200 Subject: [PATCH] Add bash completion for `service rollback` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 542b0013ba..c0f92afca5 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -3101,6 +3101,7 @@ _docker_service() { logs ls rm + rollback scale ps update @@ -3215,6 +3216,20 @@ _docker_service_rm() { esac } +_docker_service_rollback() { + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--detach=false -d --help --quit -q" -- "$cur" ) ) + ;; + *) + local counter=$( __docker_pos_first_nonflag ) + if [ "$cword" -eq "$counter" ]; then + __docker_complete_services + fi + ;; + esac +} + _docker_service_scale() { case "$cur" in -*)