help: cleanup template syntax (consistent whitespace)

This commit is contained in:
albertony 2024-08-12 22:40:57 +02:00
parent 62233b4993
commit 303358eeda

View File

@ -216,13 +216,13 @@ Examples:
{{.Example}}{{end}}{{if and (showCommands .) .HasAvailableSubCommands}} {{.Example}}{{end}}{{if and (showCommands .) .HasAvailableSubCommands}}
Available commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} Available commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if and (showLocalFlags .) .HasAvailableLocalFlags}} {{rpad .Name .NamePadding}} {{.Short}}{{end}}{{end}}{{end}}{{if and (showLocalFlags .) .HasAvailableLocalFlags}}
Flags: Flags:
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if and (showGlobalFlags .) .HasAvailableInheritedFlags}}{{ range flagGroups . }}{{ if .Flags.HasFlags }} {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if and (showGlobalFlags .) .HasAvailableInheritedFlags}}{{range flagGroups .}}{{if .Flags.HasFlags}}
{{ .Help }} (flag group {{ .Name }}): {{.Help}} (flag group {{.Name}}):
{{ .Flags.FlagUsages | trimTrailingWhitespaces}}{{ end }}{{ end }}{{end}}{{if .HasHelpSubCommands}} {{.Flags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{end}}{{end}}{{if .HasHelpSubCommands}}
Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}}
{{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}
@ -232,14 +232,14 @@ Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services. Use "rclone help backends" for a list of supported services.
` `
var filterFlagsSingleGroupTemplate = `{{ range flagGroups . }}{{ if .Flags.HasFlags }}{{ .Flags.FlagUsages | trimTrailingWhitespaces}} var filterFlagsSingleGroupTemplate = `{{range flagGroups .}}{{if .Flags.HasFlags}}{{.Flags.FlagUsages | trimTrailingWhitespaces}}
{{ end }}{{ end }} {{end}}{{end}}
` `
var filterFlagsMultiGroupTemplate = `{{ range flagGroups . }}{{ if .Flags.HasFlags }}{{ .Help }} (flag group {{ .Name }}): var filterFlagsMultiGroupTemplate = `{{range flagGroups .}}{{if .Flags.HasFlags}}{{.Help}} (flag group {{.Name}}):
{{ .Flags.FlagUsages | trimTrailingWhitespaces}} {{.Flags.FlagUsages | trimTrailingWhitespaces}}
{{ end }}{{ end }}` {{end}}{{end}}`
var docFlagsTemplate = `--- var docFlagsTemplate = `---
title: "Global Flags" title: "Global Flags"
@ -251,16 +251,16 @@ description: "Rclone Global Flags"
This describes the global flags available to every rclone command This describes the global flags available to every rclone command
split into groups. split into groups.
{{ range flagGroups . }}{{ if .Flags.HasFlags }} {{range flagGroups .}}{{if .Flags.HasFlags}}
## {{ .Name }} ## {{.Name}}
{{ .Help }}. {{.Help}}.
` + "```" + ` ` + "```" + `
{{ .Flags.FlagUsages | trimTrailingWhitespaces}} {{.Flags.FlagUsages | trimTrailingWhitespaces}}
` + "```" + ` ` + "```" + `
{{ end }}{{ end }} {{end}}{{end}}
` `
// show all the backends // show all the backends