1
0
Fork 0

d-ssh bash completion

This commit is contained in:
Gregory Eremin 2017-10-05 13:17:55 +02:00
parent ea03ebc291
commit 762e7a9b41
1 changed files with 5 additions and 0 deletions

View File

@ -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}}" $@