Debian Codegraph @

flag_generic.go

raw symbols SCIP
1 package cliscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/
2
3 type GenericFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/GenericFlag# = FlagBasescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#[Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value#, NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#, genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#]
4
5 // -- Value Value
6 type genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue# struct {
7 valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val. Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value#
8 }
9
10 // Below functions are to satisfy the ValueCreator interface
11
12 func (f genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#) Createscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#Create().(val Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value#, p *Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value#, 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# {
13 *p = val
14 return &genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#{
15 valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val.: *p,
16 }
17 }
18
19 func (f genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#) ToStringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#ToString().(b Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value#) string {
20 f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val. = b
21 return f.Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#String().()
22 }
23
24 // Below functions are to satisfy the flag.Value interface
25
26 func (f *genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#) Setscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#Set().(s string) error {
27 if f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val. != nil {
28 return f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val..Setscip-go gomod github.com/golang/go/src go1.22 flag/Value#Set().(s)
29 }
30 return nil
31 }
32
33 func (f *genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#) Getscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#Get().() any {
34 if f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val. != nil {
35 return f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val..Getscip-go gomod github.com/golang/go/src go1.22 flag/Getter#Get().()
36 }
37 return nil
38 }
39
40 func (f *genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#) Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#String().() string {
41 if f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val. != nil {
42 return f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val..Stringscip-go gomod github.com/golang/go/src go1.22 flag/Value#String().()
43 }
44 return ""
45 }
46
47 func (f *genericValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#) IsBoolFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#IsBoolFlag().() bool {
48 if f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val. == nil {
49 return false
50 }
51 bf, ok := f.valscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/genericValue#val..(boolFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/boolFlag#)
52 return ok && bf.IsBoolFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/boolFlag#IsBoolFlag.()
53 }
54
55 // Generic looks up the value of a local GenericFlag, returns
56 // nil if not found
57 func (cmd *Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#) Genericscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Generic().(name string) Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value# {
58 if v, ok := cmd.Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Value().(name).(Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Value#); ok {
59 tracefscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/tracef().("generic 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.)
60 return v
61 }
62
63 tracefscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/tracef().("generic 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.)
64 return nil
65 }