commandlineparser / commandlineparser/commandline

How to parse a command line with an an invalid parameter

未关闭
#315 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
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?

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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