Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ZSH completion #12

Merged
merged 2 commits into from
Dec 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions zunit
Original file line number Diff line number Diff line change
Expand Up @@ -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] <tests...>"
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"
}

###
Expand Down
17 changes: 17 additions & 0 deletions zunit.zsh-completion
Original file line number Diff line number Diff line change
@@ -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 "$@"