Last active
December 12, 2016 14:41
-
-
Save omerucel/d53b7900f5bdf3ed6341dfeeeee17165 to your computer and use it in GitHub Desktop.
Docker exec helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload bashcompinit // for oh-my-zsh | |
bashcompinit // for oh-my-zsh | |
docker-exec() { | |
docker exec -it $1 /bin/bash | |
} | |
_dockerexec() { | |
local cur="${COMP_WORDS[COMP_CWORD]}" | |
local names=$(docker ps --format="{{.Names}}") | |
COMPREPLY=( $(compgen -W "${names}" ${cur}) ) | |
} | |
complete -F _dockerexec docker-exec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment