Skip to content

Commit 992b583

Browse files
authored
fix: Use the cobra CommandPath for usage to avoid duplication (#1617)
1 parent adb7d20 commit 992b583

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cli/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,6 @@ func versionTemplate() string {
264264

265265
// FormatCobraError colorizes and adds "--help" docs to cobra commands.
266266
func FormatCobraError(err error, cmd *cobra.Command) string {
267-
helpErrMsg := fmt.Sprintf("Run '%s %s --help' for usage.", cmd.Root().Name(), cmd.Name())
267+
helpErrMsg := fmt.Sprintf("Run '%s --help' for usage.", cmd.CommandPath())
268268
return cliui.Styles.Error.Render(err.Error() + "\n" + helpErrMsg)
269269
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy