Move zsh completion logic to new subcommand: attach

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
This commit is contained in:
Steve Durrheimer 2016-10-29 15:39:59 +02:00 committed by Tibor Vass
parent cfb9ce1683
commit f80a33998f
1 changed files with 11 additions and 8 deletions

View File

@ -507,15 +507,23 @@ __docker_container_commands() {
} }
__docker_container_subcommand() { __docker_container_subcommand() {
local -a _command_args opts_help local -a _command_args opts_help opts_attach_exec_run_start
local expl help="--help" local expl help="--help"
integer ret=1 integer ret=1
opts_attach_exec_run_start=(
"($help)--detach-keys=[Escape key sequence used to detach a container]:sequence:__docker_complete_detach_keys"
)
opts_help=("(: -)--help[Print usage]") opts_help=("(: -)--help[Print usage]")
case "$words[1]" in case "$words[1]" in
(attach) (attach)
__docker_subcommand && ret=0 _arguments $(__docker_arguments) \
$opts_help \
$opts_attach_exec_run_start \
"($help)--no-stdin[Do not attach stdin]" \
"($help)--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]" \
"($help -):containers:__docker_complete_running_containers" && ret=0
;; ;;
(commit) (commit)
__docker_subcommand && ret=0 __docker_subcommand && ret=0
@ -1644,12 +1652,7 @@ __docker_subcommand() {
case "$words[1]" in case "$words[1]" in
(attach) (attach)
_arguments $(__docker_arguments) \ __docker_container_subcommand && ret=0
$opts_help \
$opts_attach_exec_run_start \
"($help)--no-stdin[Do not attach stdin]" \
"($help)--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]" \
"($help -):containers:__docker_complete_running_containers" && ret=0
;; ;;
(build) (build)
_arguments $(__docker_arguments) \ _arguments $(__docker_arguments) \