From f8cf06821b3f0bdaef952765384b31089a2d5566 Mon Sep 17 00:00:00 2001 From: Ryan Schneider Date: Fri, 1 Jun 2018 14:58:33 -0700 Subject: [PATCH] cmd: Fix bug checking value conflicts (e.g. `--lightserv` conflicting with `--syncmode=light`). --- cmd/utils/flags.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index ef5f6a9f08..3001eab396 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -976,13 +976,17 @@ func checkExclusive(ctx *cli.Context, args ...interface{}) { name := flag.GetName() if i+1 < len(args) { - switch option := args[i+1].(type) { + switch 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 + option := args[i+1].(string) if ctx.GlobalString(flag.GetName()) == option { name += "=" + option + set = append(set, "--"+name) } + // shift arguments and continue i++ + continue case cli.Flag: default: