TUN-3922: Repoint urfave/cli/v2 library at patched branch at github.com/ipostelnik/cli/v2@fixed which correctly handles reading flags declared at multiple levels of subcommands.

This commit is contained in:
Igor Postelnik
2021-02-12 15:11:41 -06:00
parent a8ae6de213
commit 1670ee87fb
37 changed files with 307 additions and 274 deletions

View File

@@ -87,14 +87,10 @@ func (f *IntFlag) Apply(set *flag.FlagSet) error {
// Int looks up the value of a local IntFlag, returns
// 0 if not found
func (c *Context) Int(name string) int {
if fs := lookupFlagSet(name, c); fs != nil {
return lookupInt(name, fs)
}
return 0
return lookupInt(c.resolveFlagDeep(name))
}
func lookupInt(name string, set *flag.FlagSet) int {
f := set.Lookup(name)
func lookupInt(f *flag.Flag) int {
if f != nil {
parsed, err := strconv.ParseInt(f.Value.String(), 0, 64)
if err != nil {