commandline
commandline copied to clipboard
No error when parsing unknown arguments after verb
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?