Skip to content

Instantly share code, notes, and snippets.

@vigo
Created July 19, 2012 21:40
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 vigo/3147022 to your computer and use it in GitHub Desktop.
Save vigo/3147022 to your computer and use it in GitHub Desktop.
bash completion for "powder"
# 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