Move zsh completion logic to new subcommand: cp

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
This commit is contained in:
Steve Durrheimer 2016-10-29 15:43:07 +02:00 committed by Tibor Vass
parent aee4d2e078
commit 2d250dcaf1
1 changed files with 15 additions and 15 deletions

View File

@ -536,7 +536,20 @@ __docker_container_subcommand() {
"($help -): :__docker_repositories_with_tags" && ret=0 "($help -): :__docker_repositories_with_tags" && ret=0
;; ;;
(cp) (cp)
__docker_subcommand && ret=0 _arguments $(__docker_arguments) \
$opts_help \
"($help -L --follow-link)"{-L,--follow-link}"[Always follow symbol link]" \
"($help -)1:container:->container" \
"($help -)2:hostpath:_files" && ret=0
case $state in
(container)
if compset -P "*:"; then
_files && ret=0
else
__docker_complete_containers -qS ":" && ret=0
fi
;;
esac
;; ;;
(create) (create)
__docker_subcommand && ret=0 __docker_subcommand && ret=0
@ -1699,20 +1712,7 @@ __docker_subcommand() {
esac esac
;; ;;
(cp) (cp)
_arguments $(__docker_arguments) \ __docker_container_subcommand && ret=0
$opts_help \
"($help -L --follow-link)"{-L,--follow-link}"[Always follow symbol link]" \
"($help -)1:container:->container" \
"($help -)2:hostpath:_files" && ret=0
case $state in
(container)
if compset -P "*:"; then
_files && ret=0
else
__docker_complete_containers -qS ":" && ret=0
fi
;;
esac
;; ;;
(create) (create)
_arguments $(__docker_arguments) \ _arguments $(__docker_arguments) \