mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 06:29:59 +00:00
TUN-3963: 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:
8
vendor/github.com/urfave/cli/v2/flag_duration.go
generated
vendored
8
vendor/github.com/urfave/cli/v2/flag_duration.go
generated
vendored
@@ -86,14 +86,10 @@ func (f *DurationFlag) Apply(set *flag.FlagSet) error {
|
||||
// Duration looks up the value of a local DurationFlag, returns
|
||||
// 0 if not found
|
||||
func (c *Context) Duration(name string) time.Duration {
|
||||
if fs := lookupFlagSet(name, c); fs != nil {
|
||||
return lookupDuration(name, fs)
|
||||
}
|
||||
return 0
|
||||
return lookupDuration(c.resolveFlagDeep(name))
|
||||
}
|
||||
|
||||
func lookupDuration(name string, set *flag.FlagSet) time.Duration {
|
||||
f := set.Lookup(name)
|
||||
func lookupDuration(f *flag.Flag) time.Duration {
|
||||
if f != nil {
|
||||
parsed, err := time.ParseDuration(f.Value.String())
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user