From 54adcc154a42ad49af486ddd69d71fe51fcb8e18 Mon Sep 17 00:00:00 2001
From: ai_xiaopei <xiaopei@aisim.cn>
Date: Sun, 26 Jul 2026 13:25:10 +0800
Subject: [PATCH] fix: 参数不足时显示 help 后添加空行
---
cmd/search.go | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cmd/search.go b/cmd/search.go
index 88c0065..e7e31a1 100644
--- a/cmd/search.go
+++ b/cmd/search.go
@@ -37,6 +37,9 @@
searchCmd.Flags().BoolVar(&jsonOut, "json", false, "JSON 格式输出")
searchCmd.Flags().BoolVar(&withContent, "with-content", false, "返回完整文件内容")
searchCmd.Flags().BoolVar(&withLinks, "with-links", false, "显示关联文档链接")
+
+ // 参数不足时显示 help
+ searchCmd.SetUsageTemplate(searchCmd.Long)
}
func runSearch(cmd *cobra.Command, args []string) error {
--
Gitblit v1.9.1