fix the terminal is damaged when parameters are missing (#5175)
This commit is contained in:
@@ -74,13 +74,12 @@ func (m resyncCancelMessage) String() string {
|
||||
}
|
||||
|
||||
func mainAdminReplicateResyncCancel(ctx *cli.Context) error {
|
||||
{
|
||||
// Check argument count
|
||||
argsNr := len(ctx.Args())
|
||||
if argsNr != 2 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "cancel", 1) // last argument is exit code
|
||||
}
|
||||
// Check argument count
|
||||
argsNr := len(ctx.Args())
|
||||
if argsNr != 2 {
|
||||
showCommandHelpAndExit(ctx, 1) // last argument is exit code
|
||||
}
|
||||
|
||||
console.SetColor("ResyncMessage", color.New(color.FgGreen))
|
||||
|
||||
// Get the alias parameter from cli
|
||||
|
||||
@@ -21,10 +21,11 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/minio/madmin-go/v3"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/minio/cli"
|
||||
json "github.com/minio/colorjson"
|
||||
"github.com/minio/madmin-go/v3"
|
||||
"github.com/minio/mc/pkg/probe"
|
||||
"github.com/minio/pkg/v3/console"
|
||||
)
|
||||
@@ -74,12 +75,10 @@ func (m resyncMessage) String() string {
|
||||
}
|
||||
|
||||
func mainAdminReplicateResyncStart(ctx *cli.Context) error {
|
||||
{
|
||||
// Check argument count
|
||||
argsNr := len(ctx.Args())
|
||||
if argsNr != 2 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "start", 1) // last argument is exit code
|
||||
}
|
||||
// Check argument count
|
||||
argsNr := len(ctx.Args())
|
||||
if argsNr != 2 {
|
||||
showCommandHelpAndExit(ctx, 1) // last argument is exit code
|
||||
}
|
||||
|
||||
console.SetColor("ResyncMessage", color.New(color.FgGreen))
|
||||
|
||||
@@ -60,12 +60,10 @@ EXAMPLES:
|
||||
}
|
||||
|
||||
func mainAdminReplicationResyncStatus(ctx *cli.Context) error {
|
||||
{
|
||||
// Check argument count
|
||||
argsNr := len(ctx.Args())
|
||||
if argsNr != 2 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "status", 1) // last argument is exit code
|
||||
}
|
||||
// Check argument count
|
||||
argsNr := len(ctx.Args())
|
||||
if argsNr != 2 {
|
||||
showCommandHelpAndExit(ctx, 1) // last argument is exit code
|
||||
}
|
||||
|
||||
console.SetColor("ResyncMessage", color.New(color.FgGreen))
|
||||
|
||||
Reference in New Issue
Block a user