Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 31af06939b
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 33 lines (27 sloc) 0.739 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
# Proto tab-completion
#
# This assumes you are running proto while in its directory, eg.
# ~/proto$ ./proto <tab>
# ~/proto$ ./proto install <tab>
#
# To install drop this file into /etc/bash_completion.d/
# or add this line to your .bashrc:
# source /path/to/proto/tab-completion.sh
# and open a new terminal

_proto ()
{
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}

cmds='install update uninstall test showdeps help'

if [[ $COMP_CWORD -eq 1 ]] ; then
COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
return 0
fi

if [[ $COMP_CWORD > 1 ]]; then
COMPREPLY=( $( compgen -W '$( command cat projects.list \
| grep -i '^[a-z0-9\-]*:$' \
| sed -e 's/://' )' -- $cur ) )
return 0
fi
}

complete -F _proto -o default ./proto
Something went wrong with that request. Please try again.