Skip to content

Commit

Permalink
fix: handle zinit --help (#597)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster authored Dec 4, 2023
1 parent 3c7e5be commit 8cf9104
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 10 additions & 0 deletions tests/commands.zunit
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
assert $output contains 'Loaded: '
assert $state equals 0
}
@test 'help' {
for cmd in 'help' '-h' '--help'; do
run zinit $cmd
assert $output contains '—— help – usage information'
assert $state equals 0
done
run zinit -help
assert $output contains 'Unknown subcommand'
assert $state equals 1
}
@test 'self-update' {
run zinit self-update
assert $output contains 'Already up-to-date.'
Expand Down
3 changes: 1 addition & 2 deletions zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,14 @@ sh|silent|\
trackbinds|\
verbose"
ZINIT[cmds]="\
-help|-h|\
add-fpath|\
bindkeys|\
cclear|cd|cdclear|cdisable|cdlist|cdreplay|cenable|changes|compile|compiled|compinit|completions|create|creinstall|csearch|cuninstall|\
delete|debug|\
edit|env-whitelist|\
fpath|\
glance|\
help|\
help|--help|-h|\
ice|\
light|load|\
man|module|\
Expand Down

0 comments on commit 8cf9104

Please sign in to comment.