remove unnecessary newline and contextualize the success (#4598)

This commit is contained in:
Harshavardhana
2023-06-13 08:44:46 -07:00
committed by GitHub
parent 2ecd33086f
commit f148db7ae0
+5 -3
View File
@@ -65,17 +65,18 @@ EXAMPLES:
type configResetMessage struct {
Status string `json:"status"`
targetAlias string
key string
restart bool
}
// String colorized service status message.
func (u configResetMessage) String() (msg string) {
msg += console.Colorize("ResetConfigSuccess",
"Key is successfully reset.\n")
suggestion := fmt.Sprintf("mc admin service restart %s", u.targetAlias)
fmt.Sprintf("'%s' is successfully reset.", u.key))
if u.restart {
suggestion := fmt.Sprintf("mc admin service restart %s", u.targetAlias)
msg += console.Colorize("ResetConfigSuccess",
fmt.Sprintf("Please restart your server with `%s`.\n", suggestion))
fmt.Sprintf("\nPlease restart your server with `%s`.", suggestion))
}
return
}
@@ -144,6 +145,7 @@ func mainAdminConfigReset(ctx *cli.Context) error {
printMsg(configResetMessage{
targetAlias: aliasedURL,
restart: restart,
key: input,
})
return nil