MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / pickTargets

Function pickTargets

internal/cli/lifecycle.go:108–123  ·  view source on GitHub ↗
(registry *tools.Registry, target string)

Source from the content-addressed store, hash-verified

106func (discardWriter) Write(p []byte) (int, error) { return len(p), nil }
107
108func pickTargets(registry *tools.Registry, target string) ([]tools.Tool, error) {
109 if target == "all" {
110 out := []tools.Tool{}
111 for _, name := range registry.EnabledNames() {
112 out = append(out, registry.Tools[name])
113 }
114 return out, nil
115 }
116 if t, ok := registry.Get(target); ok {
117 return []tools.Tool{t}, nil
118 }
119 if t, ok := registry.ByCLICommand(target); ok {
120 return []tools.Tool{t}, nil
121 }
122 return nil, fmt.Errorf("Unknown target: %s", target)
123}

Callers 1

lifecycleCommandMethod · 0.85

Calls 3

EnabledNamesMethod · 0.80
ByCLICommandMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected