blob: 766306dd3a470d637a36eb1c6b27927e9aa3f6f0 [file] [log] [blame]
Jon Hall9e8c7612016-07-18 17:40:06 -07001_teston-cases()
2{
3 local dir=~/TestON
4 if [ ! -e $dir ]
5 then
6 echo
7 echo "ERROR: $dir does not exist"
8 return 1
9 fi
10 local cur=${COMP_WORDS[COMP_CWORD]}
11 COMPREPLY=( $(compgen -o dirnames -W "$(find $dir/tests -name "*.params" | grep -v __init | grep -v dependencies | xargs dirname | xargs -0 | tr '\n' '\0' | xargs -l -0 basename)" -- $cur) )
12 return 0
13}
14_teston()
15{
16 local dir=~/TestON
17 COMPREPLY=()
18 local cur=${COMP_WORDS[COMP_CWORD]}
19 local prev=${COMP_WORDS[COMP_CWORD-1]}
20
21 case "$prev" in
22 run)
23 _teston-cases
24 return $?;;
25 teston | */cli.py )
26 COMPREPLY=( $( compgen -W 'run' -- $cur ) )
27 return 0;;
28 esac
29 return 0
30}
31
32
33complete -F _teston "./cli.py"
34complete -F _teston "teston"