From a62b3436db1929b5f73e247f4d1913072db09db1 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 9 Jul 2018 19:20:45 +0200 Subject: urfave/cli: fix regression in short-opts parsing Add the actual argument, not the one we're looking for when searching the to-be-translated short-opt string. Otherwise, we're likely to hit an infinite loop. Signed-off-by: Valentin Rothberg Closes: #1066 Approved by: rhatdan --- vendor/github.com/urfave/cli/command.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'vendor/github.com') diff --git a/vendor/github.com/urfave/cli/command.go b/vendor/github.com/urfave/cli/command.go index c9ba5ec68..56b633c1a 100644 --- a/vendor/github.com/urfave/cli/command.go +++ b/vendor/github.com/urfave/cli/command.go @@ -204,7 +204,7 @@ PARSE: newArgs := Args{} for i, arg := range args { if arg != trimmed { - newArgs = append(newArgs, trimmed) + newArgs = append(newArgs, arg) continue } shortOpts := translateShortOptions(set, Args{trimmed}) @@ -215,7 +215,12 @@ PARSE: newArgs = append(newArgs, shortOpts...) newArgs = append(newArgs, args[i+1:]...) args = newArgs - // now parse again + // now reset the flagset parse again + set, err = flagSet(c.Name, c.Flags) + if err != nil { + return nil, err + } + set.SetOutput(ioutil.Discard) goto PARSE } } -- cgit v1.2.3-54-g00ecf