-
-
Save apexskier/6a453f0e06cdff363aa9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bash | |
# | |
# bash/zsh completion support for Fabric | |
# | |
# Copyright (C) 2013 Danilo Dellaquila <danilo@dellaquila.es> | |
# 2014 Cameron Little <cameron@camlittle.com> | |
# Distributed under the GNU General Public License, version 3.0. | |
# http://www.gnu.org/licenses/gpl.html | |
# | |
# To install just save the script at /etc/bash_completion.d or | |
# source it in your bash{rc,_profile}. | |
# | |
_fab() { | |
local cur commands | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
fab_l=$(fab 2>/dev/null --list | sed '0,/^Available commands:$/d' | sed '/^$/d' | sed 's/^....//' | cut -d " " -f1) | |
commands=$(for x in ${fab_l}; do echo ${x} ; done) | |
COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) ) | |
return 0 | |
} | |
complete -F _fab fab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment