Skip to content

Instantly share code, notes, and snippets.

@kwbr
Forked from exhuma/gist:2136677
Created March 26, 2012 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwbr/2207176 to your computer and use it in GitHub Desktop.
Save kwbr/2207176 to your computer and use it in GitHub Desktop.
Bash completion for fabric
#
# Bash completion for fabric
#
function _fab_complete() {
local cur
if [[ -f "fabfile.py" || -f "fabfile/__init__.py" ]]; 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
}
# 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
fi
@kwbr
Copy link
Author

kwbr commented Mar 26, 2012

Add support for fabfile modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment