Created
January 24, 2015 10:40
-
-
Save coldfire-x/1dc4994d458d81973410 to your computer and use it in GitHub Desktop.
fabric auto complete script
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
# auto complete for fab | |
function _fab_complete() { | |
local cur | |
if [[ -f "fabfile.py" || -d "fabfile" ]]; then | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
COMPREPLY=($(compgen -W "$(fab -F short -l)" -- ${cur})) | |
return 0 | |
else | |
# no fabfile.py found. Don't do anything. | |
return 1 | |
fi | |
} | |
complete -o nospace -F _fab_complete fab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment