cli
cli copied to clipboard
Subcommands do not display help for GLOBAL OPTIONS
Version: 706f78e
My initial look for a the cause is that the default SubcommandHelpTemplate does not contain:
{{if .VisiblePersistentFlags}}
GLOBAL OPTIONS:{{template "visiblePersistentFlagTemplate" .}}{{end}}
See CommandHelpTemplate where this is implemented.
I've found this to be the case as well if the -h flag is not used. If the -h flag is used then the CommandHelpTemplate is used which does include the GLOBAL OPTIONS snippet. If the -h flag is not used then the SubcommandHelpTemplate is used which does not include the GLOBAL OPTIONS snippet. I haven't traced through the logic of where that template choice is being made. Not sure which side the solution should be on really.