Skip to content

Instantly share code, notes, and snippets.

@m-ueno
Created August 13, 2013 08:10
Show Gist options
  • Save m-ueno/6218914 to your computer and use it in GitHub Desktop.
Save m-ueno/6218914 to your computer and use it in GitHub Desktop.
# https://github.com/sgruhier/rake_cap_bash_autocomplete/blob/master/rake_cap_bash_autocomplete.sh
export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/}
_capcomplete() {
COMPREPLY=($(compgen -W "`cap -T 2>/dev/null| awk '{{ if ( $3 ~ /\#/ ) print $2}}'`" -- ${COMP_WORDS[COMP_CWORD]}))
return 0
}
complete -o default -o nospace -F _capcomplete cap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment