diff --git a/cmd/admin-config-history.go b/cmd/admin-config-history.go index 10487db9..1e5cc918 100644 --- a/cmd/admin-config-history.go +++ b/cmd/admin-config-history.go @@ -127,7 +127,7 @@ func mainAdminConfigHistory(ctx *cli.Context) error { client, err := newAdminClient(aliasedURL) fatalIf(err, "Unable to initialize admin connection.") - if ctx.IsSet("clear") { + if ctx.Bool("clear") { fatalIf(probe.NewError(client.ClearConfigHistoryKV(globalContext, "all")), "Unable to clear server configuration.") // Print diff --git a/cmd/admin-config-reset.go b/cmd/admin-config-reset.go index 265504c9..ee8614ff 100644 --- a/cmd/admin-config-reset.go +++ b/cmd/admin-config-reset.go @@ -116,13 +116,13 @@ func mainAdminConfigReset(ctx *cli.Context) error { if len(ctx.Args()) == 1 { // Call get config API - hr, e := client.HelpConfigKV(globalContext, "", "", ctx.IsSet("env")) + hr, e := client.HelpConfigKV(globalContext, "", "", ctx.Bool("env")) fatalIf(probe.NewError(e), "Unable to get help for the sub-system") // Print printMsg(configHelpMessage{ Value: hr, - envOnly: ctx.IsSet("env"), + envOnly: ctx.Bool("env"), }) return nil diff --git a/cmd/admin-config-set.go b/cmd/admin-config-set.go index ed265616..49295132 100644 --- a/cmd/admin-config-set.go +++ b/cmd/admin-config-set.go @@ -112,13 +112,13 @@ func mainAdminConfigSet(ctx *cli.Context) error { if !strings.Contains(input, madmin.KvSeparator) { // Call get config API - hr, e := client.HelpConfigKV(globalContext, args.Get(1), args.Get(2), ctx.IsSet("env")) + hr, e := client.HelpConfigKV(globalContext, args.Get(1), args.Get(2), ctx.Bool("env")) fatalIf(probe.NewError(e), "Unable to get help for the sub-system") // Print printMsg(configHelpMessage{ Value: hr, - envOnly: ctx.IsSet("env"), + envOnly: ctx.Bool("env"), }) return nil diff --git a/cmd/admin-replicate-remove.go b/cmd/admin-replicate-remove.go index 931fd691..6a971441 100644 --- a/cmd/admin-replicate-remove.go +++ b/cmd/admin-replicate-remove.go @@ -95,15 +95,15 @@ func (i srRemoveStatus) String() string { func checkAdminReplicateRemoveSyntax(ctx *cli.Context) { // Check argument count argsNr := len(ctx.Args()) - if ctx.IsSet("all") && argsNr > 1 { + if ctx.Bool("all") && argsNr > 1 { fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...), "") } - if argsNr < 2 && !ctx.IsSet("all") { + if argsNr < 2 && !ctx.Bool("all") { fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...), "Need at least two arguments to remove command.") } - if !ctx.IsSet("force") { + if !ctx.Bool("force") { fatalIf(errDummy().Trace(), "Site removal requires --force flag. This operation is *IRREVERSIBLE*. Please review carefully before performing this *DANGEROUS* operation.") } diff --git a/cmd/admin-service-restart.go b/cmd/admin-service-restart.go index bf0f0223..cf82bd1b 100644 --- a/cmd/admin-service-restart.go +++ b/cmd/admin-service-restart.go @@ -251,7 +251,7 @@ func mainAdminServiceRestart(ctx *cli.Context) error { fatalIf(err, "Unable to initialize admin connection.") rowCount := 2 - toWait := ctx.IsSet("wait") + toWait := ctx.Bool("wait") if toWait { rowCount = 3 } diff --git a/cmd/globals.go b/cmd/globals.go index 0aea141d..a9101362 100644 --- a/cmd/globals.go +++ b/cmd/globals.go @@ -112,13 +112,13 @@ func parsePagerDisableFlag(args []string) { // Set global states. NOTE: It is deliberately kept monolithic to ensure we dont miss out any flags. func setGlobalsFromContext(ctx *cli.Context) error { - quiet := ctx.IsSet("quiet") || ctx.GlobalIsSet("quiet") - debug := ctx.IsSet("debug") || ctx.GlobalIsSet("debug") - json := ctx.IsSet("json") || ctx.GlobalIsSet("json") - noColor := ctx.IsSet("no-color") || ctx.GlobalIsSet("no-color") - insecure := ctx.IsSet("insecure") || ctx.GlobalIsSet("insecure") - devMode := ctx.IsSet("dev") || ctx.GlobalIsSet("dev") - airgapped := ctx.IsSet("airgap") || ctx.GlobalIsSet("airgap") + quiet := ctx.Bool("quiet") || ctx.GlobalBool("quiet") + debug := ctx.Bool("debug") || ctx.GlobalBool("debug") + json := ctx.Bool("json") || ctx.GlobalBool("json") + noColor := ctx.Bool("no-color") || ctx.GlobalBool("no-color") + insecure := ctx.Bool("insecure") || ctx.GlobalBool("insecure") + devMode := ctx.Bool("dev") || ctx.GlobalBool("dev") + airgapped := ctx.Bool("airgap") || ctx.GlobalBool("airgap") globalQuiet = globalQuiet || quiet globalDebug = globalDebug || debug diff --git a/cmd/pipe-main.go b/cmd/pipe-main.go index 2cfe3170..6b221fa7 100644 --- a/cmd/pipe-main.go +++ b/cmd/pipe-main.go @@ -191,7 +191,7 @@ func mainPipe(ctx *cli.Context) error { fatalIf(err, "Unable to parse encryption keys.") // globalQuiet is true for no window size to get. We just need --quiet here. - quiet := ctx.IsSet("quiet") + quiet := ctx.Bool("quiet") meta := map[string]string{} if attr := ctx.String("attr"); attr != "" { diff --git a/cmd/replicate-backlog.go b/cmd/replicate-backlog.go index 5136eda2..3cd85e7f 100644 --- a/cmd/replicate-backlog.go +++ b/cmd/replicate-backlog.go @@ -519,7 +519,7 @@ func mainReplicateBacklog(cliCtx *cli.Context) error { // Create a new MinIO Admin Client client, cerr := newAdminClient(aliasedURL) fatalIf(cerr, "Unable to initialize admin connection.") - if !cliCtx.IsSet("full") { + if !cliCtx.Bool("full") { mrfCh := client.BucketReplicationMRF(ctx, bucket, cliCtx.String("nodes")) if globalJSON { for mrf := range mrfCh {