commandlineparser / commandlineparser/commandline

How to parse a command line with an an invalid parameter

Open
#315 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.8k
Forks
478
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.