mirror of
https://github.com/zunit-zsh/zunit.git
synced 2026-09-10 06:36:15 -04:00
65 lines
2 KiB
Plaintext
65 lines
2 KiB
Plaintext
#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 "$@"
|