1
0
mirror of https://github.com/minio/mc.git synced 2025-12-08 22:28:28 +03:00

Fix incorrect bool parsing (#4991)

For example `--json=false` would still print JSON.

Went through all usage, and I think I covered them all.
This commit is contained in:
Klaus Post
2024-07-18 09:08:30 -07:00
committed by GitHub
parent ded36374e8
commit f6df01d750
8 changed files with 18 additions and 18 deletions

View File

@@ -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.")
}