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

Method PreParse

flag_bool_with_inverse.go:70–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68}
69
70func (bif *BoolWithInverseFlag) PreParse() error {
71 count := bif.Config.Count
72 if count == nil {
73 count = &bif.count
74 }
75 dest := bif.Destination
76 if dest == nil {
77 dest = new(bool)
78 }
79 *dest = bif.Value
80 bif.value = &boolValue{
81 destination: dest,
82 count: count,
83 }
84
85 // Validate the given default or values set from external sources as well
86 if bif.Validator != nil && bif.ValidateDefaults {
87 if err := bif.Validator(bif.value.Get().(bool)); err != nil {
88 return err
89 }
90 }
91 bif.applied = true
92 return nil
93}
94
95func (bif *BoolWithInverseFlag) PostParse() error {
96 tracef("postparse (flag=%[1]q)", bif.Name)

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected