Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pkg/cobrautl/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
},
"indent": func(s string) string {
pad := strings.Repeat(" ", 2)
return pad + strings.Replace(s, "\n", "\n"+pad, -1)
return pad + strings.ReplaceAll(s, "\n", "\n"+pad)
},
}
)
Expand Down Expand Up @@ -106,7 +106,11 @@ GLOBAL OPTIONS:
{{end}}
`[1:]

commandUsageTemplate = template.Must(template.New("command_usage").Funcs(templFuncs).Parse(strings.ReplaceAll(commandUsage, "\\\n", "")))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid reformatting code unrelated to PR goal.

commandUsageTemplate = template.Must(
template.New("command_usage").
Funcs(templFuncs).
Parse(strings.ReplaceAll(commandUsage, "\\\n", "")),
)
}

func etcdFlagUsages(flagSet *pflag.FlagSet) string {
Expand Down