commandlineparser / commandlineparser/commandline

Why is DefaultSentenceBuilder private?

未关闭
#503 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
C#
星标
4.8k
派生
478
PR 合并指标
30 天内没有已合并 PR

描述

Is there a reason that `DefaultSentenceBuilder` is marked `private`? It would be much easier to customize `SentenceBuilder` if the class were public and could be inherited.
```csharp
public class MySentenceBuilder: DefaultSentenceBuilder
{
public override Func UsageHeadingText => () => "Usage:";
}

SentenceBuilder.Factory = () => new MySentenceBuilder();
```

Another possibility would be to make `SentenceBuilder` non-abstract, move the default implementations there from `DefaultSentenceBuilder`, and then get rid of `DefaultSentenceBuilder` altogether.

贡献指南

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

调研方向

首先定位 DefaultSentenceBuilder 和 SentenceBuilder 的声明,并检查 SentenceBuilder.Factory 的使用方式。将提议的继承方案与把默认实现移入 SentenceBuilder 的方案进行比较,然后确定应支持哪些自定义行为以及应如何对其进行验证。

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

评估

技术栈
csharp
领域
cli
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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