riak_test/utils/riak_test.bash

30 lines
908 B
Bash
Raw Normal View History

2013-12-06 20:40:11 +00:00
# bash_completion for riak_test
_riak_test()
{
local cur prev tests
if type _get_comp_words_by_ref &>/dev/null; then
_get_comp_words_by_ref cur prev
else
for i in ${!COMP_WORDS[*]}; do
prev=$cur
cur=${COMP_WORDS[$i]}
done
fi
2013-12-06 20:40:11 +00:00
case $prev in
riak_test|*/riak_test)
COMPREPLY=( $(compgen -W "-h -c -t -s -d -x -v -o -b -u -r -F \
--help --conf --tests --suites \
--dir --skip --verbose --outdir --backend \
--upgrade --report --file" -- "$cur") )
2013-12-06 20:40:11 +00:00
;;
-t|--tests)
tests=$(grep -l confirm/0 ./tests/*.erl 2>/dev/null \
| xargs basename -s .erl)
COMPREPLY=( $(compgen -W "$tests" -- "$cur") )
2013-12-06 20:40:11 +00:00
;;
esac
}
complete -F _riak_test riak_test