-
Notifications
You must be signed in to change notification settings - Fork 0
/
.completion
69 lines (68 loc) · 2.39 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
# `complete` for zsh
if type complete &>/dev/null; then
:
else
autoload bashcompinit
bashcompinit
fi
# completion for jestfs
_jestfs_completions() {
local cur prev opts lastc informats outformats datafiles
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
cmdList="help fuzz conform-test test262-test categorize-bug draw-figure"
globalOpt="-silent -error -status -time"
helpOpt=""
extractOpt="-extract:target -extract:log -extract:repl"
compileOpt="-compile:log -compile:log-with-loc"
buildcfgOpt="-build-cfg:log -build-cfg:dot -build-cfg:pdf"
fuzzOpt="-fuzz:log-interval -fuzz:debug -fuzz:timeout -fuzz:trial -fuzz:duration -fuzz:seed -fuzz:k-fs -fuzz:cp"
gentestOpt="-gen-test:debug -gen-test:engines -gen-test:transpilers -gen-test:use-cache -gen-test:only -gen-test:skip"
conformtestOpt="-conform-test:debug -conform-test:msgdir -conform-test:save-bugs"
test262testOpt="-test262-test:debug -test262-test:log -test262-test:target -test262-test:progress -test262-test:coverage -test262-test:timeout -test262-test:k-fs -test262-test:cp -test262-test:no-test-mode"
categorizebugOpt=""
drawfigureOpt=""
# 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
;;
fuzz)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${fuzzOpt}"))
return 0
;;
conform-test)
COMPREPLY=($(compgen -W "${globalOpt} ${gentestOpt} ${conformtestOpt}"))
return 0
;;
test262-test)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${test262testOpt}"))
return 0
;;
categorize-bug)
COMPREPLY=($(compgen -W "${globalOpt} ${categorizebugOpt}"))
return 0
;;
draw-figure)
COMPREPLY=($(compgen -W "${globalOpt} ${extractOpt} ${compileOpt} ${buildcfgOpt} ${drawfigureOpt}"))
return 0
;;
esac
return 0
;;
esac
COMPREPLY=( $(compgen -X '' -f "${cur}") )
}
# completion setting
complete -o filenames -o bashdefault -F _jestfs_completions jestfs