Show metadata-only groups in parent help inventories
This commit is contained in:
@@ -96,7 +96,7 @@ func UsageLine(root *Command, path []string) (string, *Failure) {
|
||||
return "", &Failure{Message: "usage path is not registered"}
|
||||
}
|
||||
line := selected.UseLine()
|
||||
if selected.HasAvailableSubCommands() {
|
||||
if selected.HasSubCommands() {
|
||||
line += " [command]"
|
||||
}
|
||||
return line, nil
|
||||
@@ -235,11 +235,11 @@ func buildTree(root *Command, options ParseOptions) (*spfcobra.Command, map[*Com
|
||||
const usageTemplate = `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}}
|
||||
|
||||
{{end}}Usage:
|
||||
{{.UseLine}}{{if .HasAvailableSubCommands}}
|
||||
{{.CommandPath}} [command]{{end}}{{if .HasAvailableSubCommands}}
|
||||
{{.UseLine}}{{if .HasSubCommands}}
|
||||
{{.CommandPath}} [command]{{end}}{{if .HasSubCommands}}
|
||||
|
||||
Available Commands:{{range .Commands}}{{if .IsAvailableCommand}}
|
||||
{{rpad .Name .NamePadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
|
||||
Available Commands:{{range .Commands}}
|
||||
{{rpad .Name .NamePadding}} {{.Short}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
|
||||
|
||||
Flags:
|
||||
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}
|
||||
|
||||
Reference in New Issue
Block a user