MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / flagSource

Method flagSource

internal/cmdhelp/dynamic.go:95–104  ·  view source on GitHub ↗

flagSource looks up the enum_source for a flag on the given command path. Returns ("", false) when no binding applies.

(path, name string)

Source from the content-addressed store, hash-verified

93// flagSource looks up the enum_source for a flag on the given command
94// path. Returns ("", false) when no binding applies.
95func (r *Resolver) flagSource(path, name string) (string, bool) {
96 name = strings.ToLower(name)
97 if specific, ok := r.CommandFlagBindings[path][name]; ok {
98 return specific, true
99 }
100 if global, ok := r.FlagEnumSources[name]; ok {
101 return global, true
102 }
103 return "", false
104}
105
106// Apply walks doc and stamps EnumSource + resolved Enum values on
107// matching args and flags. Resolution failures are silent: the document

Callers 1

ApplyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected