зеркало из https://github.com/microsoft/docker.git
Merge pull request #17153 from albers/completion-cp-args
[Fix 17029] docker cp completion not correct
This commit is contained in:
Коммит
4786ac1ffe
|
@ -561,9 +561,18 @@ _docker_cp() {
|
|||
return
|
||||
;;
|
||||
*)
|
||||
# combined container and filename completion
|
||||
_filedir
|
||||
local files=( ${COMPREPLY[@]} )
|
||||
|
||||
__docker_containers_all
|
||||
COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) )
|
||||
__docker_nospace
|
||||
local containers=( ${COMPREPLY[@]} )
|
||||
|
||||
COMPREPLY=( $( compgen -W "${files[*]} ${containers[*]}" -- "$cur" ) )
|
||||
if [[ "$COMPREPLY" == *: ]]; then
|
||||
__docker_nospace
|
||||
fi
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
@ -571,7 +580,13 @@ _docker_cp() {
|
|||
(( counter++ ))
|
||||
|
||||
if [ $cword -eq $counter ]; then
|
||||
_filedir -d
|
||||
if [ -e "$prev" ]; then
|
||||
__docker_containers_all
|
||||
COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) )
|
||||
__docker_nospace
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
return
|
||||
fi
|
||||
;;
|
||||
|
|
Загрузка…
Ссылка в новой задаче