-
Notifications
You must be signed in to change notification settings - Fork 290
Passing extra arguments after "help (verb)" causes an InvalidOperationException #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@rmunn, thanks for detailed reporting, I'll try fix both issues (the exception and I'll update you here. Thanks, again! |
When you invoke your app with:
--help is enumerated as an option because the canonical help request, requires you to put "--help" as first argument. In this case the help screen is showed not because you added "--help" but because the command line syntax rules are not respected. I need reason a little more on this... The main issue anyway is fixed, in seconds I'll merge to master... |
Version 2.0.239-beta fixes the issue (just released to NuGet), if this works can you please close the issue? Thanks, @rmunn. |
Regarding
For example:
Whereas:
But the |
I've tested version 2.0.239-beta, and it works the way I want now (barring the "Option 'help' is unknown" error). This issue is fixed. |
@rmunn, after some reasoning I'm agree with you that listing This is now fixed in version 2.0.241-beta on master and released to NuGet. Anyway an eventual If you're interested in internals: Bye! :) |
Using CommandLineParser 2.0.235.0 beta, I can cause an InvalidOperationException by simply running "my-cmd.exe help verb foo" instead of "my-cmd.exe help verb". "my-cmd.exe help verb" produces the expected help text, but "my-cmd.exe help verb foo" produces the following exception:
Running "my-cmd.exe verb foo --help" works, sort of (I don't like the "Option 'help' is unknown) error, but I can live with it. But I'm pretty sure that users will at one point try replacing "my-cmd.exe verb foo bar -v" with "my-cmd.exe help verb foo bar -v" to get help usage, and I'd like this to be handled. So when the "help" verb is invoked, I'd like it to ignore any further arguments, but not throw an exception if they are present.
The text was updated successfully, but these errors were encountered: