forked from yvoronoy/m2install
-
Notifications
You must be signed in to change notification settings - Fork 3
/
m2install-bash-completion
61 lines (58 loc) · 1.68 KB
/
m2install-bash-completion
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
#
# Completion for m2install
#
_m2install()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help -h --source -s --force -f --sample-data --step --ee-path --ee --git-branch --mode --quiet --php --code-dump --db-dump --debug --skip-post-deploy --restore-table";
case "$prev" in
--source)
COMPREPLY=( $(compgen -W "git composer" ${cur}) )
return 0;
;;
-s)
COMPREPLY=( $(compgen -W "git composer" ${cur}) )
return 0;
;;
--sample-data)
COMPREPLY=( $(compgen -W "yes no" ${cur}) )
return 0;
;;
--ee-path)
COMPREPLY=( $(compgen -W "$(ls -d */ 2>/dev/null)" ${cur}) )
return 0;
;;
--git-branch)
COMPREPLY=( $(compgen -W "$(git branch | sed s/*//g)" ${cur}) )
return 0;
;;
--mode)
COMPREPLY=( $(compgen -W "dev prod" ${cur}) )
return 0;
;;
--php)
COMPREPLY=( $(compgen -W "php71" ${cur}) )
return 0;
;;
--code-dump)
COMPREPLY=( $(compgen -f ${cur}) )
return 0;
;;
--db-dump)
COMPREPLY=( $(compgen -f ${cur}) )
return 0;
;;
--step)
COMPREPLY=( $(compgen -W "restore_code restore_db configure_db configure_files" ${cur}) )
return 0;
;;
--restore-table)
COMPREPLY=( $(compgen -W "table-name" ${cur}) )
return 0;
esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
}
complete -F _m2install m2install.sh