Skip to content

Instantly share code, notes, and snippets.

@whusnoopy
Created July 17, 2014 08:08
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 whusnoopy/a82772e294efe5a4a58f to your computer and use it in GitHub Desktop.
Save whusnoopy/a82772e294efe5a4a58f to your computer and use it in GitHub Desktop.
fabric auto complete builder
# source this file before use fab
# copy from github.com/jjanyan/joshix and modified
_fab_completion() {
COMPREPLY=()
# Fabfile in this folder?
[[ -e fabfile.py ]] || [[ -e fabfile/__init__.py ]] || return 0
local cur="${COMP_WORDS[COMP_CWORD]}"
tasks=$(fab --shortlist)
COMPREPLY=( $(compgen -W "${tasks}" -- ${cur}) )
}
complete -F _fab_completion fab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment