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

Interface Flag

flag.go:91–112  ·  flag.go::Flag

Flag is a common interface related to parsing flags in cli. For more advanced flag parsing techniques, it is recommended that this interface be implemented.

Source from the content-addressed store, hash-verified

89// For more advanced flag parsing techniques, it is recommended that
90// this interface be implemented.
91type Flag interface {
92 fmt.Stringer
93
94 // Retrieve the value of the Flag
95 Get() any
96
97 // Lifecycle methods.
98 // flag callback prior to parsing
99 PreParse() error
100
101 // flag callback post parsing
102 PostParse() error
103
104 // Apply Flag settings to the given flag set
105 Set(string, string) error
106
107 // All possible names for this flag
108 Names() []string
109
110 // Whether the flag has been set or not
111 IsSet() bool
112}
113
114// RequiredFlag is an interface that allows us to mark flags as required
115// it allows flags required flags to be backwards compatible with the Flag interface

Callers 27

runMethod · 0.65
runMethod · 0.65
SetMethod · 0.65
SetMethod · 0.65
TestFlagsByNameFunction · 0.95

Implementers 3

BoolWithInverseFlagflag_bool_with_inverse.go
extFlagflag_ext.go
customBoolFlagcommand_test.go

Calls

no outgoing calls

Tested by

no test coverage detected