From 71d55f50a92d9dc86036c4c1752aa887a6e22db0 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sat, 23 Mar 2013 18:47:34 -0500 Subject: [PATCH] .bash_completion.d/fabric.bash: Bash completion for Fabric --- .bash_completion.d/fabric.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .bash_completion.d/fabric.bash diff --git a/.bash_completion.d/fabric.bash b/.bash_completion.d/fabric.bash new file mode 100644 index 0000000..0284c1d --- /dev/null +++ b/.bash_completion.d/fabric.bash @@ -0,0 +1,17 @@ +# +# Bash completion for fabric +# (https://gist.github.com/exhuma/2136677) +# +function _fab_complete() { +local cur +if [[ -f "fabfile.py" || -d "fabfile" ]]; 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 +} + +complete -o nospace -F _fab_complete fab -- 2.47.1