2013-12-06 20:40:11 +00:00
|
|
|
# bash_completion for riak_test
|
|
|
|
_riak_test()
|
|
|
|
{
|
2014-04-23 00:08:29 +00:00
|
|
|
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
|
2014-04-23 00:08:29 +00:00
|
|
|
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
|
|
|
;;
|
2014-04-23 00:08:29 +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
|
|
|
|
|