commandlineparser / commandlineparser/commandline

Support fake results

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

描述

**Issue by [themacguffinman](https://github.com/themacguffinman)**
_Thursday Aug 25, 2016 at 06:58 GMT_
_Originally opened as https://github.com/gsscoder/commandline/issues/345_

----

Right now it's impossible to raise my own parser errors because all classes relating to the error system are `sealed` with `internal` constructors.

This snippet from `HelpTextTests` is completely inaccessible:

```
var fakeResult = new NotParsed(
TypeInfo.Create(typeof(NullInstance)),
new Error[]
{
new BadFormatTokenError("badtoken"),
new MissingValueOptionError(new NameInfo("x", "switch")),
new UnknownOptionError("unknown"),
new MissingRequiredOptionError(new NameInfo("", "missing")),
new SequenceOutOfRangeError(new NameInfo("s", "sequence")),
new NoVerbSelectedError(),
new BadVerbSelectedError("badverb"),
new HelpRequestedError(), // should be ignored
new HelpVerbRequestedError(null, null, false) // should be ignored
});
```

Please publicly expose the error system to support custom error management.

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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