commandline icon indicating copy to clipboard operation
commandline copied to clipboard

No error when parsing unknown arguments after verb

Open aaronenberg opened this issue 3 years ago • 0 comments

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?

aaronenberg avatar May 17 '22 15:05 aaronenberg