fix: Use the cobra CommandPath for usage to avoid duplication (#1617)

This commit is contained in:
Mathias Fredriksson
2022-05-20 12:42:56 +03:00
committed by GitHub
parent adb7d20c16
commit 992b58389b
+1 -1
View File
@@ -264,6 +264,6 @@ func versionTemplate() string {
// FormatCobraError colorizes and adds "--help" docs to cobra commands.
func FormatCobraError(err error, cmd *cobra.Command) string {
helpErrMsg := fmt.Sprintf("Run '%s %s --help' for usage.", cmd.Root().Name(), cmd.Name())
helpErrMsg := fmt.Sprintf("Run '%s --help' for usage.", cmd.CommandPath())
return cliui.Styles.Error.Render(err.Error() + "\n" + helpErrMsg)
}