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.

貢獻指南

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

研究方向

從 HelpTextTests 範例開始,檢查其中使用的錯誤類別,包括 NotParsed 和 Error 的子類別。確定哪些 sealed 宣告和 internal 建構函式阻止外部自訂錯誤處理,然後驗證錯誤系統可以被公開使用,同時不會破壞現有的 HelpTextTests 行為,包括被忽略的說明錯誤。

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

評估

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

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

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