forked from yvoronoy/m2install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm2install-bash-completion
46 lines (43 loc) · 1.16 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
#
# Completion for m2install
#
_m2install()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --source --force --sample-data --ee-path --git-branch --mode --quiet --code-dump --db-dump";
case "$prev" in
--source)
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;
;;
--code-dump)
COMPREPLY=( $(compgen -f ${cur}) )
return 0;
;;
--db-dump)
COMPREPLY=( $(compgen -f ${cur}) )
return 0;
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
}
complete -F _m2install m2install.sh