From 6d732cc27c7a8a9783ed48026d6d18f80009c003 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Fri, 13 Dec 2024 10:27:25 +0800 Subject: [PATCH] cmd/utils: fix bug when checking for flag value conflicts (#17803) --- cmd/utils/flags.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 18ce92a23fc8..d244803b84d3 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1318,11 +1318,14 @@ func checkExclusive(ctx *cli.Context, args ...interface{}) { if i+1 < len(args) { switch option := args[i+1].(type) { case string: - // Extended flag, expand the name and shift the arguments + // Extended flag check, make sure value set doesn't conflict with passed in option if ctx.String(flag.Names()[0]) == option { name += "=" + option + set = append(set, "--"+name) } + // shift arguments and continue i++ + continue case cli.Flag: default: