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);
}
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 issue 中的 DisplayHelp 示例开始,检查 HelpText.AutoBuild 的结果以及其中显示的 logging 调用。确定应如何拆分生成的帮助文本以用于单独的 Log.Information 调用,然后验证输出是否按预期保留每一行帮助文本。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
cli
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。