commandlineparser / commandlineparser/commandline
No error when parsing unknown arguments after verb
- 主要語言
- C#
- 星號
- 4.8k
- 分支
- 478
- PR 合併指標
- 30 天內沒有已合併 PR
描述
You can try this with your CLI program (replace `program.exe verb` as appropriate):
`program.exe verb unknownarg`
Replace unknownarg with any random inputs as long as they don't start with `-` and `Parser.Default.ParseArguments` will return `ParserResult.WithParsed`.
It doesn't matter what the value of `ParserSettings.IgnoreUnknownArguments` is.
I don't know if this is a bug or just hasn't been implemented but this is a fundamental problem with the built-in validation of this library.
Does anyone have any solutions to catch unknown args?
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
首先,透過 `Parser.Default.ParseArguments` 重現 `program.exe verb unknownarg`,並按照描述變更 `ParserSettings.IgnoreUnknownArguments`。追蹤 verb 和位置引數的剖析路徑;當未知引數能以符合預期驗證行為的方式一致地處理,且回報的案例由回歸測試涵蓋時,該 issue 即完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp
- 領域
- cli
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100