Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Bash completion for fabric
# Bash completion for fabric
function _fab_complete() {
local cur
if [[ -f "" || -d "fabfile" ]]; then
COMPREPLY=( $(compgen -W "$(fab -F short -l)" -- ${cur}) )
return 0
# no found. Don't do anything.
return 1
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
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