diff --git a/zunit b/zunit index f15a26e..00c8466 100755 --- a/zunit +++ b/zunit @@ -330,13 +330,14 @@ function assert() { # Output usage information and exit ### function _zunit_usage() { - echo "\033[0;33mUsage:\033[0;m" + echo "$(color yellow 'Usage:')" echo " zunit [options] " echo - echo "\033[0;33mOptions:\033[0;m" + echo "$(color yellow 'Options:')" echo " -h, --help Output help text and exit" echo " -v, --version Output version information and exit" echo " -f, --fail-fast Stop the test runner immediately after the first failure" + echo " -t, --tap Output results in a TAP compatible format" } ### diff --git a/zunit.zsh-completion b/zunit.zsh-completion new file mode 100644 index 0000000..fe9ce69 --- /dev/null +++ b/zunit.zsh-completion @@ -0,0 +1,17 @@ +#compdef zunit + +_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]' + + _arguments \ + '*:test:_files' +} + +_zunit "$@"