Move zsh completion logic to new subcommand: cp
@@ -536,7 +536,20 @@ __docker_container_subcommand() {
"($help -): :__docker_repositories_with_tags" && ret=0
;;
(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)
__docker_subcommand && ret=0
@@ -1699,20 +1712,7 @@ __docker_subcommand() {
esac
;;
(cp)
- _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
+ __docker_container_subcommand && ret=0
;;
(create)
_arguments $(__docker_arguments) \
