commandlineparser / commandlineparser/commandline
How to parse a command line with an an invalid parameter
- 主要語言
- C#
- 星號
- 4.8k
- 分支
- 478
- PR 合併指標
- 30 天內沒有已合併 PR
描述
I want to parse command line but with the possibility of providing an incorrect parameter.
I tried for example:
```
Parser.Default.ParseArguments(Environment.GetCommandLineArgs())
.WithNotParsed(errs => {
// code for errors
})
.WithParsed(opt => {
// code for valid options
});
```
but in situation when any command line parametr is incorrect commandline parser calls only code for errors handling ( "code for errors" in my example).
So how to handle valid parameters and skip incorrect?
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
未指定原始檔案或測試。首先追蹤 Parser.Default.ParseArguments(Environment.GetCommandLineArgs()) 以及 WithNotParsed 和 WithParsed 回呼,以了解目前的行為;要完成這項工作,需要就如何在處理無效參數的同時處理有效參數達成共識。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp
- 領域
- cli
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100