From 428866e28def25593e7dd73f1c3bd909db47635b Mon Sep 17 00:00:00 2001 From: Johan Kaving Date: Sat, 6 Jan 2024 12:32:18 +0100 Subject: [PATCH] fix(macos): print usage for `man-preview` with no args (#12147) --- plugins/macos/macos.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index e27d412c8..a4347005e 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -224,6 +224,8 @@ function quick-look() { } function man-preview() { + [[ $# -eq 0 ]] && >&2 echo "Usage: $0 command1 [command2 ...]" && return 1 + local page for page in "${(@f)"$(man -w $@)"}"; do command mandoc -Tpdf $page | open -f -a Preview