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:
@@ -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.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user