forked from zunit-zsh/zunit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_zunit
64 lines (54 loc) · 2 KB
/
_zunit
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
#compdef zunit
_zunit_commands=(
'run:Run tests'
'init:Bootstrap ZUnit in a new project'
)
_zunit() {
typeset -A opt_args
local context state line curcontext="$curcontext"
_arguments \
'1: :_zunit_cmds' \
'*::arg:->args'
_arguments \
'*:tests:_files'
_arguments -A \
'(-h --help)'{-h,--help}'[show help text and exit]' \
'(-v --version)'{-v,--version}'[show version information and exit]' \
'(-f --fail-fast)'{-f,--fail-fast}'[stop execution after the first failure]' \
'(-t --tap)'{-t,--tap}'[output results in a TAP compatible format]' \
'--verbose[prints full output from each test]' \
'--output-text[print results to a text log, in TAP compatible format]' \
'--output-html[print results to a HTML page]' \
'--allow-risky[supress warnings generated for risky tests]' \
'--time-limit[set a time limit in seconds for each test]'
case "$state" in
args )
case "$words[1]" in
init )
_arguments -A \
'(-h --help)'{-h,--help}'[show help text and exit]' \
'(-t --travis)'{-t,--travis}'[generate a .travis.yml file]'
_arguments \
'*::arg:->args'
;;
run )
_arguments -A \
'(-h --help)'{-h,--help}'[show help text and exit]' \
'(-f --fail-fast)'{-f,--fail-fast}'[stop execution after the first failure]' \
'(-t --tap)'{-t,--tap}'[output results in a TAP compatible format]' \
'--verbose[prints full output from each test]' \
'--output-text[print results to a text log, in TAP compatible format]' \
'--output-html[print results to a HTML page]' \
'--allow-risky[supress warnings generated for risky tests]' \
'--time-limit[set a time limit in seconds for each test]'
_arguments \
'*:tests:_files'
;;
esac
;;
esac
}
(( $+functions[_zunit_cmds] )) || _zunit_cmds() {
_describe -t commands 'commands' _zunit_commands "$@"
}
_zunit "$@"