mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-07-15 03:09:10 +00:00
go: updating modules
It seems this may be the last update to urfave/cli for go1.17, as their v2.25 uses generics of go1.18 and didn't partition it with build tags 😵😵😵 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
c6a7295705
commit
45591ed121
40 changed files with 2475 additions and 731 deletions
14
vendor/github.com/urfave/cli/v2/flag_duration.go
generated
vendored
14
vendor/github.com/urfave/cli/v2/flag_duration.go
generated
vendored
|
@ -32,7 +32,7 @@ func (f *DurationFlag) GetDefaultText() string {
|
|||
if f.DefaultText != "" {
|
||||
return f.DefaultText
|
||||
}
|
||||
return f.GetValue()
|
||||
return f.defaultValue.String()
|
||||
}
|
||||
|
||||
// GetEnvVars returns the env vars for this flag
|
||||
|
@ -42,6 +42,9 @@ func (f *DurationFlag) GetEnvVars() []string {
|
|||
|
||||
// Apply populates the flag given the flag set and environment
|
||||
func (f *DurationFlag) Apply(set *flag.FlagSet) error {
|
||||
// set default value so that environment wont be able to overwrite it
|
||||
f.defaultValue = f.Value
|
||||
|
||||
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||
if val != "" {
|
||||
valDuration, err := time.ParseDuration(val)
|
||||
|
@ -70,6 +73,15 @@ func (f *DurationFlag) Get(ctx *Context) time.Duration {
|
|||
return ctx.Duration(f.Name)
|
||||
}
|
||||
|
||||
// RunAction executes flag action if set
|
||||
func (f *DurationFlag) RunAction(c *Context) error {
|
||||
if f.Action != nil {
|
||||
return f.Action(c, c.Duration(f.Name))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Duration looks up the value of a local DurationFlag, returns
|
||||
// 0 if not found
|
||||
func (cCtx *Context) Duration(name string) time.Duration {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue