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
How to display the full help of a command when an error occures? #1423
Comments
Hmm, there is not direct support for either. (Perhaps the CommanderError could include the failing command as a property.) On a related note, the unknown command error got modified to include a reference to the help.
|
I think you could display the appropriate help by subclassing and overriding |
Inspired by your suggestions:
I then have access to the command in my Thanks. |
An answer was worked out, and no further activity in a month. Closing this as resolved. Feel free to open a new issue if it comes up again, with new information and renewed interest. |
Related: |
Let's say an
option
is required but is missing. Commander then automatically displays a short "error: required option '--myOption' not specified" message. But what if, in addition to this message, I also want to display the full help of the command? Is this possible?And, related question:
I do use
exitOverride()
and a bigtry/catch
block. AfterparseAsync()
has been called on a command with subcommands, is there a way to know what is the subcommand that was actually called? If an error occures and I could know the subcommand in mycatch
block, I guess I could display the help by myself (usingsubCommand.outputHelp()
).The text was updated successfully, but these errors were encountered: