MCPcopy Index your code
hub / github.com/router-for-me/CLIProxyAPI / Set

Method Set

internal/pluginhost/command_line.go:203–221  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

201}
202
203func (v *commandLineFlagValue) Set(raw string) error {
204 if v == nil || v.host == nil {
205 return nil
206 }
207 normalized, okValue := normalizeCommandLineFlagValue(v.kind, raw)
208 if !okValue {
209 return fmt.Errorf("invalid %s value %q", v.kind, raw)
210 }
211 v.host.mu.Lock()
212 record, okRecord := v.host.commandLineFlags[v.name]
213 if okRecord {
214 record.value = normalized
215 record.set = true
216 v.host.commandLineFlags[v.name] = record
217 v.host.commandLineHits[v.name] = struct{}{}
218 }
219 v.host.mu.Unlock()
220 return nil
221}
222
223func (v *commandLineFlagValue) IsBoolFlag() bool {
224 return v != nil && v.kind == "bool"

Calls 1