diff --git a/internal/helpers/doc_local_preflight.go b/internal/helpers/doc_local_preflight.go index bcc428ae..c1e2a750 100644 --- a/internal/helpers/doc_local_preflight.go +++ b/internal/helpers/doc_local_preflight.go @@ -191,7 +191,7 @@ func validateDocLocalArgs(cmd *cobra.Command) error { return docLocalError(cmd, CodeMissingParam, "--scope "+scope+" 必须提供 --start-block-id", "先用 dws doc block list --node --format json 获取真实 blockId") } if cmd.Flags().Changed("output") && format != "jsonml" { - return docLocalError(cmd, CodeInvalidParam, "--output 仅支持 --content-format jsonml", "Markdown 请读取 stdout 或使用 shell 重定向;JSONML 示例: dws doc read --node --content-format jsonml --output ./body.json") + return docLocalError(cmd, CodeInvalidParam, "--output 仅支持 --content-format jsonml", "Markdown 内容会直接显示在终端;如需保存为文件,请执行: dws doc read --node --content-format markdown --format raw > body.md") } if (scope != "" || tags != "") && format != "jsonml" { return docLocalError(cmd, CodeInvalidParam, "--scope/--tags requires --content-format jsonml", "示例: dws doc read --node --content-format jsonml --scope tags --tags h1,h2") diff --git a/internal/helpers/doc_local_preflight_test.go b/internal/helpers/doc_local_preflight_test.go index 8bcff084..8674e47e 100644 --- a/internal/helpers/doc_local_preflight_test.go +++ b/internal/helpers/doc_local_preflight_test.go @@ -90,7 +90,7 @@ func TestDocLocalPreflightSecondBatchRejectsBeforeMCP(t *testing.T) { {"read-tags-wrong-scope", []string{"read", "--node", "n", "--content-format", "jsonml", "--scope", "outline", "--tags", "h1"}, "--tags only works"}, {"read-range-start-missing", []string{"read", "--node", "n", "--content-format", "jsonml", "--scope", "range"}, "--start-block-id"}, {"read-section-start-missing", []string{"read", "--node", "n", "--content-format", "jsonml", "--scope", "section"}, "--start-block-id"}, - {"read-markdown-output", []string{"read", "--node", "n", "--content-format", "markdown", "--output", "body.json"}, "仅支持 --content-format jsonml"}, + {"read-markdown-output", []string{"read", "--node", "n", "--content-format", "markdown", "--output", "body.json"}, "Markdown 内容会直接显示在终端"}, {"create-whitespace-name", []string{"create", "--name", " "}, "--name"}, {"update-empty-content", []string{"update", "--node", "n", "--content", " ", "--mode", "append"}, "非空内容"}, {"update-dry-run-append", []string{"update", "--node", "n", "--content", "x", "--mode", "append", "--dry-run"}, "仅用于预览 overwrite"},