Skip to content

Instantly share code, notes, and snippets.

@mdippery
Created October 4, 2010 19:22
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 mdippery/610269 to your computer and use it in GitHub Desktop.
Save mdippery/610269 to your computer and use it in GitHub Desktop.
A bash completion script for Fabric targets
# A bash completion script for Fabric targets
# Author: Michael Dippery <mdippery@gmail.com>
_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