MCPcopy
hub / github.com/spf13/pflag / TextVarP

Method TextVarP

text.go:69–71  ·  view source on GitHub ↗

TextVarP is like TextVar, but accepts a shorthand letter that can be used after a single dash.

(p encoding.TextUnmarshaler, name, shorthand string, value encoding.TextMarshaler, usage string)

Source from the content-addressed store, hash-verified

67
68// TextVarP is like TextVar, but accepts a shorthand letter that can be used after a single dash.
69func (f *FlagSet) TextVarP(p encoding.TextUnmarshaler, name, shorthand string, value encoding.TextMarshaler, usage string) {
70 f.VarP(newTextValue(value, p), name, shorthand, usage)
71}
72
73// TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type of the default value must be the same as the type of p.
74func TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string) {

Callers

nothing calls this directly

Calls 2

VarPMethod · 0.95
newTextValueFunction · 0.85

Tested by

no test coverage detected