MCPcopy
hub / github.com/alecthomas/kong / Value

Struct Value

model.go:244–263  ·  view source on GitHub ↗

A Value is either a flag or a variable positional argument.

Source from the content-addressed store, hash-verified

242
243// A Value is either a flag or a variable positional argument.
244type Value struct {
245 Flag *Flag // Nil if positional argument.
246 Name string
247 Help string
248 OrigHelp string // Original help string, without interpolated variables.
249 HasDefault bool
250 Default string
251 DefaultValue reflect.Value
252 Enum string
253 Mapper Mapper
254 Tag *Tag
255 Target reflect.Value
256 Required bool
257 Set bool // Set to true when this value is set through some mechanism.
258 Format string // Formatting directive, if applicable.
259 Position int // Position (for positional arguments).
260 Passthrough bool // Deprecated: Use PassthroughMode instead. Set to true to stop flag parsing when encountered.
261 PassthroughMode PassthroughMode //
262 Active bool // Denotes the value is part of an active branch in the CLI.
263}
264
265// EnumMap returns a map of the enums in this value.
266func (v *Value) EnumMap() map[string]bool {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected