Created
July 19, 2012 21:40
-
-
Save vigo/3147022 to your computer and use it in GitHub Desktop.
bash completion for "powder"
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
# you must install powder gem | |
# | |
# gem install powder | |
# | |
# | |
_powder() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts="`powder | tail -r | awk '{print $2}' | xargs`" | |
if [[ ${cur} == * ]] ; then | |
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
return 0 | |
fi | |
} | |
complete -F _powder powder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment