commandlineparser / commandlineparser/commandline

Outputting help text as individual lines

未關閉
#559 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
C#
星號
4.8k
分支
478
PR 合併指標
30 天內沒有已合併 PR

描述

Beyond parsing the string into lines, how would I modify this to call `Log.Information()` for each line of help generated? It seems the API is capable of this, but I'm obviously struggling to figure it out myself.

```
static void DisplayHelp(ParserResult result, IEnumerable errs) {
var helpText = HelpText.AutoBuild(result, h => {
h.AutoHelp = true;
h.AutoVersion = true;
return HelpText.DefaultParsingErrorsHandler(result, h);
}, e => e);
Log.Information(helpText);
}
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start with the DisplayHelp example in the issue and inspect the HelpText.AutoBuild result and the logging call shown there. Determine how the generated help text should be split for individual Log.Information calls, then verify the output preserves each help line as intended.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp
領域
cli
Issue 類型
功能
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。