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 big try/catch block. After parseAsync() 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 my catch block, I guess I could display the help by myself (using subCommand.outputHelp()).
Let's say an
optionis 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/catchblock. 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 mycatchblock, I guess I could display the help by myself (usingsubCommand.outputHelp()).