diff --git a/bash/docker.bash b/bash/docker.bash index 6a914ef..8c37bbb 100644 --- a/bash/docker.bash +++ b/bash/docker.bash @@ -1,6 +1,11 @@ function d-ssh { docker exec -it $1 /bin/bash } +function _d-ssh { + local cur=${COMP_WORDS[COMP_CWORD]} + COMPREPLY=($(compgen -o nospace -W "$(docker ps -a --format '{{.Names}}')" -- $cur)) +} +complete -F _d-ssh d-ssh function d-ps { docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}\t{{.CreatedAt}}" $@