From d2ef5775b800c5534edf7ad0f4abe9285db09929 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Thu, 20 Oct 2016 09:22:22 +0200 Subject: [PATCH] Move bash completion logic to new subcommand: update Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 74 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index ec4fbf8f6c..1508850502 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1657,7 +1657,42 @@ _docker_container_unpause() { } _docker_container_update() { - _docker_update + local options_with_args=" + --blkio-weight + --cpu-period + --cpu-quota + --cpuset-cpus + --cpuset-mems + --cpu-shares -c + --kernel-memory + --memory -m + --memory-reservation + --memory-swap + --restart + " + + local boolean_options=" + --help + " + + local all_options="$options_with_args $boolean_options" + + __docker_complete_restart && return + + case "$prev" in + $(__docker_to_extglob "$options_with_args") ) + return + ;; + esac + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "$all_options" -- "$cur" ) ) + ;; + *) + __docker_complete_containers_all + ;; + esac } _docker_container_wait() { @@ -2993,42 +3028,7 @@ _docker_unpause() { } _docker_update() { - local options_with_args=" - --blkio-weight - --cpu-period - --cpu-quota - --cpuset-cpus - --cpuset-mems - --cpu-shares -c - --kernel-memory - --memory -m - --memory-reservation - --memory-swap - --restart - " - - local boolean_options=" - --help - " - - local all_options="$options_with_args $boolean_options" - - __docker_complete_restart && return - - case "$prev" in - $(__docker_to_extglob "$options_with_args") ) - return - ;; - esac - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W "$all_options" -- "$cur" ) ) - ;; - *) - __docker_complete_containers_all - ;; - esac + _docker_container_update } _docker_top() {