Skip to content

Commit cfcc475

Browse files
ryanschneiderkaralabe
authored andcommitted
cmd/utils: fix bug when checking for flag value conflicts (#17803)
1 parent c5d34fc commit cfcc475

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎cmd/utils/flags.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,11 +1085,14 @@ func checkExclusive(ctx *cli.Context, args ...interface{}) {
10851085
if i+1 < len(args) {
10861086
switch option := args[i+1].(type) {
10871087
case string:
1088-
// Extended flag, expand the name and shift the arguments
1088+
// Extended flag check, make sure value set doesn't conflict with passed in option
10891089
if ctx.GlobalString(flag.GetName()) == option {
10901090
name += "=" + option
1091+
set = append(set, "--"+name)
10911092
}
1093+
// shift arguments and continue
10921094
i++
1095+
continue
10931096

10941097
case cli.Flag:
10951098
default:

0 commit comments

Comments
 (0)