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

Method PreParse

flag_impl.go:160–177  ·  flag_impl.go::V].PreParse
()

Source from the content-addressed store, hash-verified

158}
159
160func (f *FlagBase[T, C, V]) PreParse() error {
161 newVal := f.Value
162
163 if f.Destination == nil {
164 f.value = f.creator.Create(newVal, new(T), f.Config)
165 } else {
166 f.value = f.creator.Create(newVal, f.Destination, f.Config)
167 }
168
169 // Validate the given default or values set from external sources as well
170 if f.Validator != nil && f.ValidateDefaults {
171 if err := f.Validator(f.value.Get().(T)); err != nil {
172 return err
173 }
174 }
175 f.applied = true
176 return nil
177}
178
179// Set applies given value from string
180func (f *FlagBase[T, C, V]) Set(_ string, val string) error {

Callers 1

SetMethod · 0.95

Calls 2

CreateMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected