浏览代码

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

Johan Kaving 4 月之前
父节点
当前提交
428866e28d
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      plugins/macos/macos.plugin.zsh

+ 2 - 0
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