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
Родитель 0d5a1cbaae
Коммит 532513153f
1 изменённых файлов: 32 добавлений и 1 удалений

Просмотреть файл

@ -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() {