You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue with the way Cobra shows Usage section in Help message. I have rootCmd that has sub-commands and flags. Both can be given at the same time. Cobra shows the Usage section as:
This is a root command
Usage:
rootCmd [flags]
rootCmd [command]
Available Commands:
print print a message
list list version
Flags:
-h, --help help message
-v, --verbose verbose
it might raise confusion as this indicates either flags or commands can be given at a time, which is not helpful.
I want only the Usage section to be modified, and leave the rest of the help message as is.
desired output:
This is a root command
Usage:
rootCmd [flags] [command]
Available Commands:
print print a message
list list version
Flags:
-h, --help help message
-v, --verbose verbose
[flags] and [commands] are in the same line
using SetUsageTemplate completely overrides the help message, hence removing available commands and flags section
The text was updated successfully, but these errors were encountered:
I have an issue with the way Cobra shows Usage section in Help message. I have rootCmd that has sub-commands and flags. Both can be given at the same time. Cobra shows the Usage section as:
it might raise confusion as this indicates either
flags
orcommands
can be given at a time, which is not helpful.I want only the Usage section to be modified, and leave the rest of the help message as is.
desired output:
[flags]
and[commands]
are in the same lineusing
SetUsageTemplate
completely overrides the help message, hence removing available commands and flags sectionThe text was updated successfully, but these errors were encountered: