zunit-zsh.zunit/zunit.zsh-completion

56 lines
1.8 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 -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]' \
'--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]'
_arguments \
'1: :_zunit_cmds' \
'*::arg:->args'
case "$state" in
args )
case "$words[1]" in
init )
_arguments -A \
'(-h --help)'{-h,--help}'[show help text and exit]' \
'(-v --version)'{-v,--version}'[show version information and exit]'
;;
run )
_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]' \
'--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]'
_arguments \
'*:tests:_files'
;;
esac
;;
esac
}
(( $+functions[_zunit_cmds] )) || _zunit_cmds() {
_describe -t commands 'commands' _zunit_commands "$@"
}
_zunit "$@"