Bash completion for docker kill

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2015-02-02 21:16:18 +01:00 committed by Tibor Vass
parent aa33ee11d0
commit 063a4f574a
1 changed files with 32 additions and 1 deletions

View File

@ -169,6 +169,23 @@ __docker_capabilities() {
" -- "$cur" ) ) " -- "$cur" ) )
} }
# a selection of the available signals that is most likely of interest in the
# context of docker containers.
__docker_signals() {
local signals=(
SIGCONT
SIGHUP
SIGINT
SIGKILL
SIGQUIT
SIGSTOP
SIGTERM
SIGUSR1
SIGUSR2
)
COMPREPLY=( $( compgen -W "${signals[*]} ${signals[*]#SIG}" -- "$( echo $cur | tr '[:lower:]' '[:upper:]')" ) )
}
_docker_docker() { _docker_docker() {
local boolean_options=" local boolean_options="
--api-enable-cors --api-enable-cors
@ -417,7 +434,21 @@ _docker_inspect() {
} }
_docker_kill() { _docker_kill() {
__docker_containers_running case "$prev" in
--signal|-s)
__docker_signals
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--signal -s" -- "$cur" ) )
;;
*)
__docker_containers_running
;;
esac
} }
_docker_load() { _docker_load() {