Created
October 4, 2010 19:22
-
-
Save mdippery/610269 to your computer and use it in GitHub Desktop.
A bash completion script for Fabric targets
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
# A bash completion script for Fabric targets | |
# Author: Michael Dippery <[email protected]> | |
_complete_fabric() { | |
COMPREPLY=() | |
if [ -e ./fabfile.py ]; then | |
local targets=$(fab -l | sed '1,2d' | awk '{print $1}') | |
local cur="${COMP_WORDS[COMP_CWORD]}" | |
COMPREPLY=( $(compgen -W "${targets}" -- ${cur}) ) | |
fi | |
} | |
complete -o bashdefault -o default -F _complete_fabric fab | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment