MCPcopy
hub / github.com/urfave/cli / Generic

Method Generic

flag_generic.go:57–65  ·  flag_generic.go::Command.Generic

Generic looks up the value of a local GenericFlag, returns nil if not found

(name string)

Source from the content-addressed store, hash-verified

55// Generic looks up the value of a local GenericFlag, returns
56// nil if not found
57func (cmd *Command) Generic(name string) Value {
58 if v, ok := cmd.Value(name).(Value); ok {
59 tracef("generic available for flag name %[1]q with value=%[2]v (cmd=%[3]q)", name, v, cmd.Name)
60 return v
61 }
62
63 tracef("generic NOT available for flag name %[1]q (cmd=%[2]q)", name, cmd.Name)
64 return nil
65}

Callers 2

TestParseGenericFromEnvFunction · 0.95

Calls 2

ValueMethod · 0.95
tracefFunction · 0.85

Tested by 2

TestParseGenericFromEnvFunction · 0.76