Closed balupton closed 5 years ago
This fixes the behaviour of formatCmdUsage
Template file to test:
{{define "FormatCommands"}}\ {{range .FlattenedCommands}} ## {{formatCmdUsage $ .}} {{template "FormatUsage" .}}\ {{end}}\ {{end}}\ \ {{define "FormatUsage"}} {{if .Help}}\ {{.Help|Wrap 0}}\ {{end}}\ {{end}}\ \ {{if not .Context.SelectedCommand}}\ # <command> [<args> ...] {{template "FormatUsage" .App}} {{end}} {{if .Context.Flags}} Flags: {{.Context.Flags|FlagsToTwoColumns|FormatTwoColumns}} {{end}} {{if .Context.Args}} Args: {{.Context.Args|ArgsToTwoColumns|FormatTwoColumns}} {{end}} {{if .Context.SelectedCommand}} {{if len .Context.SelectedCommand.Commands}} Subcommands: {{template "FormatCommands" .Context.SelectedCommand}} {{end}}\ {{else if .App.Commands}} Commands: {{template "FormatCommands" .App}} {{end}}
This fixes the behaviour of formatCmdUsage
Template file to test: