From 8cf9104ac08da3f7f108a32e0a3b117e22681d46 Mon Sep 17 00:00:00 2001 From: vladislav doster <10052309+vladdoster@users.noreply.github.com> Date: Mon, 4 Dec 2023 05:30:34 -0600 Subject: [PATCH] fix: handle zinit --help (#597) Signed-off-by: Vladislav Doster --- tests/commands.zunit | 10 ++++++++++ zinit.zsh | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/commands.zunit b/tests/commands.zunit index 6add5034c..6a109b8f7 100644 --- a/tests/commands.zunit +++ b/tests/commands.zunit @@ -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.' diff --git a/zinit.zsh b/zinit.zsh index 3179b6661..cc536fccc 100644 --- a/zinit.zsh +++ b/zinit.zsh @@ -111,7 +111,6 @@ 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|\ @@ -119,7 +118,7 @@ delete|debug|\ edit|env-whitelist|\ fpath|\ glance|\ -help|\ +help|--help|-h|\ ice|\ light|load|\ man|module|\