-
Notifications
You must be signed in to change notification settings - Fork 73
/
bash_manage.sh
90 lines (79 loc) · 2.7 KB
/
bash_manage.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
manage.sh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
prev2="${COMP_WORDS[COMP_CWORD-2]}"
case "${prev}" in
manage.sh)
local opts="make_environment\
run_tests\
run_tests_par\
compile_and_test\
compile_and_test_par\
download_test_db\
download_test_db_dev\
clean"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
;;
esac
if [[ ${prev2} == "manage.sh" ]] ; then
case "${prev}" in
install_and_check|install|work_in_python_version|make_environment)
local versions="3.7"
COMPREPLY=( $(compgen -W "${versions}" -- ${cur}) )
return 0
;;
*)
;;
esac
fi
return 0
}
source_manage.sh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
prev2="${COMP_WORDS[COMP_CWORD-2]}"
case "${prev}" in
manage.sh)
local opts="install_and_check\
install\
work_in_python_version\
work_in_python_version_no_tests\
make_environment\
run_tests\
run_tests_par\
compile_and_test\
compile_and_test_par\
download_test_db\
download_test_db_dev\
clean"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
;;
esac
if [[ ${prev2} == "manage.sh" ]] ; then
case "${prev}" in
install_and_check|install|work_in_python_version|make_environment)
local versions="3.7"
COMPREPLY=( $(compgen -W "${versions}" -- ${cur}) )
return 0
;;
*)
;;
esac
fi
return 0
}
complete -F manage.sh -o bashdefault -o default bash
complete -F source_manage.sh -o bashdefault -o default source
complete -F source_manage.sh -o bashdefault -o default .