This commit is contained in:
Ryan Schneider 2018-10-01 21:01:27 +00:00 committed by GitHub
commit 8a2da221fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1083,13 +1083,17 @@ func checkExclusive(ctx *cli.Context, args ...interface{}) {
name := flag.GetName() name := flag.GetName()
if i+1 < len(args) { if i+1 < len(args) {
switch option := args[i+1].(type) { switch args[i+1].(type) {
case string: 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 { if ctx.GlobalString(flag.GetName()) == option {
name += "=" + option name += "=" + option
set = append(set, "--"+name)
} }
// shift arguments and continue
i++ i++
continue
case cli.Flag: case cli.Flag:
default: default: