That would mean defining your own Usage function, which is possible using usageFunc
Or using a specific Usage template (command#SetUsageTemplate()
), as stated in the "Defining your own usage" README
section.
You can see the default template here. It does include an Aliases section:
Aliases:
{{.NameAndAliases}}{{end}}{{if .HasExample}}
All you would need is define the same temaplate, but exclusing the Aliases
part.
You can see an example of such a temmplate for emacski/redact
.
And yes, it has no Aliases
.
{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}}{{end}}
{{if .HasAvailableLocalFlags}}
Options:
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableSubCommands}}
Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}}
Use "{{.CommandPath}} COMMAND --help" for more information about a command.{{end}}