Skip to content

Instantly share code, notes, and snippets.

@rca
Forked from davidszotten/gist:1091866
Created February 4, 2012 09:55
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 rca/1736835 to your computer and use it in GitHub Desktop.
Save rca/1736835 to your computer and use it in GitHub Desktop.
fabric bash completion
_fab()
{
_fab_commands=$(fab --shortlist)
local cur prev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
COMPREPLY=( $(compgen -W "${_fab_commands}" -- ${cur}) )
case "${COMPREPLY}" in
# commands i frequently add options to, add colon instead of space
aws_name|aws_host)
COMPREPLY="$COMPREPLY:"
;;
*)
COMPREPLY="$COMPREPLY "
;;
esac
return 0
}
complete -o nospace -F _fab fab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment