-
-
Save rca/1736835 to your computer and use it in GitHub Desktop.
fabric bash completion
This file contains hidden or 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
_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