summaryrefslogtreecommitdiff
path: root/vendor/github.com/urfave/cli
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@suse.com>2018-07-09 19:20:45 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-09 20:02:29 +0000
commita62b3436db1929b5f73e247f4d1913072db09db1 (patch)
tree86bb0d735922cb282ae2fd069cdb362d55b0c024 /vendor/github.com/urfave/cli
parent4855998f1cf533b27e48b2ded5541841fe6a3ea6 (diff)
downloadpodman-a62b3436db1929b5f73e247f4d1913072db09db1.tar.gz
podman-a62b3436db1929b5f73e247f4d1913072db09db1.tar.bz2
podman-a62b3436db1929b5f73e247f4d1913072db09db1.zip
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 <vrothberg@suse.com> Closes: #1066 Approved by: rhatdan
Diffstat (limited to 'vendor/github.com/urfave/cli')
-rw-r--r--vendor/github.com/urfave/cli/command.go9
1 files changed, 7 insertions, 2 deletions
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
}
}