Skip to content

Instantly share code, notes, and snippets.

@coldfire-x
Created January 24, 2015 10:40
Show Gist options
  • Save coldfire-x/1dc4994d458d81973410 to your computer and use it in GitHub Desktop.
Save coldfire-x/1dc4994d458d81973410 to your computer and use it in GitHub Desktop.
fabric auto complete script
# 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