Created
July 27, 2016 07:15
-
-
Save royingantaginting/187b8b00150cd1c6cdd7e71fa99d2af2 to your computer and use it in GitHub Desktop.
Autocomplete for docker-ip command line at https://gist.github.com/royingantaginting/fffd71cbba082cddbccc8d07f97a12fe
This file contains hidden or 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
_docker_ip() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts=$(docker ps --format "{{ .Names }}") | |
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
return 0 | |
} | |
complete -F _docker_ip docker-ip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment