428866e28def25593e7dd73f1c3bd909db47635b

Author
Johan Kaving <johan.kaving@looklet.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(macos): print usage for `man-preview` with no args (#12147)

Diff

 1diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh
 2index e27d412c822ac899ae64425ef5390e524a97dc3d..a4347005e1e34890287687b9f6f300b02fba7c90 100644
 3--- a/plugins/macos/macos.plugin.zsh
 4+++ b/plugins/macos/macos.plugin.zsh
 5@@ -224,6 +224,8 @@ function quick-look() {
 6 }
 7 
 8 function man-preview() {
 9+  [[ $# -eq 0 ]] && >&2 echo "Usage: $0 command1 [command2 ...]" && return 1
10+
11   local page
12   for page in "${(@f)"$(man -w $@)"}"; do
13     command mandoc -Tpdf $page | open -f -a Preview