-
Notifications
You must be signed in to change notification settings - Fork 14
/
.completion
90 lines (89 loc) · 3.18 KB
/
.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
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
# `complete` for zsh
if type complete &>/dev/null; then
:
else
autoload bashcompinit
bashcompinit
fi
# completion for esmeta
_esmeta_completions() {
local cur prev opts lastc informats outformats datafiles
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
cmdList="help extract compile build-cfg tycheck parse eval web test262-test inject mutate"
globalOpt="-silent -error -status -time -test262dir"
helpOpt=""
extractOpt="-extract:target -extract:log -extract:eval -extract:repl"
compileOpt="-compile:log -compile:log-with-loc"
buildcfgOpt="-build-cfg:log -build-cfg:dot -build-cfg:pdf"
tycheckOpt="-tycheck:target -tycheck:repl -tycheck:repl-continue -tycheck:ignore -tycheck:update-ignore -tycheck:log -tycheck:detail-log -tycheck:type-sens -tycheck:infer-guard"
parseOpt="-parse:debug"
evalOpt="-eval:timeout -eval:multiple -eval:log -eval:detail-log"
webOpt="-web:port"
test262testOpt="-test262-test:target -test262-test:features -test262-test:progress -test262-test:coverage -test262-test:timeout -test262-test:with-yet -test262-test:log -test262-test:detail-log -test262-test:concurrent"
injectOpt="-inject:defs -inject:out -inject:log"
mutateOpt="-mutate:out -mutate:mutator -mutate:untilValid"
# completion for commands
case "${COMP_CWORD}" in
1)
COMPREPLY=($(compgen -W "version -version --version ${cmdList}"))
return 0
;;
esac
cmd="${COMP_WORDS[1]}"
# completion for options
case "${cur}" in
-*)
case "${cmd}" in
help)
COMPREPLY=($(compgen -W "${globalOpt} ${helpOpt}"))
return 0
;;
extract)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt}"))
return 0
;;
compile)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt}"))
return 0
;;
build-cfg)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt}"))
return 0
;;
tycheck)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${tycheckOpt}"))
return 0
;;
parse)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${parseOpt}"))
return 0
;;
eval)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${evalOpt}"))
return 0
;;
web)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${webOpt}"))
return 0
;;
test262-test)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${test262testOpt}"))
return 0
;;
inject)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${injectOpt}"))
return 0
;;
mutate)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${mutateOpt}"))
return 0
;;
esac
return 0
;;
esac
COMPREPLY=( $(compgen -X '' -f "${cur}") )
}
# completion setting
complete -o filenames -o bashdefault -F _esmeta_completions esmeta