| 1 | package cliscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.22 fmt/" |
| 5 | "timescip-go gomod github.com/golang/go/src go1.22 time/" |
| 6 | ) |
| 7 | |
| 8 | type DurationFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/DurationFlag# = FlagBasescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#[timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration#, NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#, durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#] |
| 9 | |
| 10 | // -- time.Duration Value |
| 11 | type durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue# timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration# |
| 12 | |
| 13 | // Below functions are to satisfy the ValueCreator interface |
| 14 | |
| 15 | func (d durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#) Createscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#Create().(val timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration#, p *timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration#, c NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#) Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value# { |
| 16 | *p = val |
| 17 | return (*durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#)(p) |
| 18 | } |
| 19 | |
| 20 | func (d durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#) ToStringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#ToString().(val timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration#) string { |
| 21 | d = durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#(val) |
| 22 | return d.Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#String().() |
| 23 | } |
| 24 | |
| 25 | // Below functions are to satisfy the flag.Value interface |
| 26 | |
| 27 | func (d *durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#) Setscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#Set().(s string) error { |
| 28 | v, err := timescip-go gomod github.com/golang/go/src go1.22 time/.ParseDurationscip-go gomod github.com/golang/go/src go1.22 time/ParseDuration().(s) |
| 29 | if err != nil { |
| 30 | return err |
| 31 | } |
| 32 | *d = durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#(v) |
| 33 | return err |
| 34 | } |
| 35 | |
| 36 | func (d *durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#) Getscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#Get().() any { return timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration#(*d) } |
| 37 | |
| 38 | func (d *durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#) Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#String().() string { |
| 39 | return fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.22 fmt/Sprintf().("%v", timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration#(*d)) |
| 40 | } |
| 41 | |
| 42 | func (cmd *Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#) Durationscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Duration().(name string) timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration# { |
| 43 | if v, ok := cmd.Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Value().(name).(timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration#); ok { |
| 44 | tracefscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/tracef().("duration available for flag name %[1]q with value=%[2]v (cmd=%[3]q)", name, v, cmd.Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Name.) |
| 45 | return v |
| 46 | } |
| 47 | |
| 48 | tracefscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/tracef().("duration NOT available for flag name %[1]q (cmd=%[2]q)", name, cmd.Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Name.) |
| 49 | return 0 |
| 50 | } |