formatted docker completion

pull/1782/head
Gurkirat Singh 2021-01-10 19:22:47 +05:30
parent 5be5d6933d
commit 15461c4ca5
No known key found for this signature in database
GPG Key ID: CFD64E1DCB3DA835
1 changed files with 11 additions and 9 deletions

View File

@ -7,15 +7,17 @@ _command_exists docker || return
complete -p docker &>/dev/null && return complete -p docker &>/dev/null && return
_docker_bash_completion_paths=( _docker_bash_completion_paths=(
# MacOS # MacOS
'/Applications/Docker.app/Contents/Resources/etc/docker.bash-completion' '/Applications/Docker.app/Contents/Resources/etc/docker.bash-completion'
# Linux # Linux
'/usr/share/bash-completion/completions/docker' '/usr/share/bash-completion/completions/docker'
) )
for fn in "${_docker_bash_completion_paths[@]}" ; do for fn in "${_docker_bash_completion_paths[@]}"
if [ -r "$fn" ] ; then do
source "$fn" if [ -r "$fn" ]
break then
fi source "$fn"
break
fi
done done