Use the custom help template in ShowSubcommand
What type of PR is this?
- bug
What this PR does / why we need it:
The custom help template was not getting used in subcommand help. This is called when using HideHelpCommand. Updated ShowSubcommand to use the custom template.
It's possible a minor refactor in the help display cases is needed here, but this change fixes our immediate problem.
Which issue(s) this PR fixes:
No known issue, just discovered locally.
Special notes for your reviewer:
None.
Testing
Test case for the bug added.
Release Notes
Bug fix: use the custom help template in a subcommand when in HideHelpCommand is active
@adrian-thurston the subcommand help is supposed to use the subcommand template. I think you have your logic backwards. If subcommand template is empty then it can use the main command template
@adrian-thurston the subcommand help is supposed to use the subcommand template. I think you have your logic backwards. If subcommand template is empty then it can use the main command template
@dearchap Should there be a separate customization for the subcommand help then? I'm more interested in customizing it, rather than specializing it differently between command and subcommand.
@adrian-thurston When you say customization for subcommand what do you mean ?
@dearchap In V2 we would set CustomHelpTemplate on cli.Command and it would get used for prog cmd --help and prog cmd subcmd --help.
In V3 it gets used only on prog cmd --help. For subcommands it uses the default.