MCPcopy Create free account
hub / github.com/246859/AutoToolBox / FindTargetTools

Function FindTargetTools

toolbox/toolbox.go:232–247  ·  view source on GitHub ↗

FindTargetTools returns tools with specific names

(tools []*Tool, targets []string, all bool)

Source from the content-addressed store, hash-verified

230
231// FindTargetTools returns tools with specific names
232func FindTargetTools(tools []*Tool, targets []string, all bool) []*Tool {
233 var targetTools []*Tool
234 if all {
235 targetTools = tools
236 } else {
237 for _, target := range targets {
238 for _, tool := range tools {
239 if tool.Name == target {
240 targetTools = append(targetTools, tool)
241 break
242 }
243 }
244 }
245 }
246 return toolFilter(targetTools, legacy)
247}
248
249// ReadSubCommands returns current menu items
250func ReadSubCommands() ([]string, bool, error) {

Callers 3

RunSetFunction · 0.92
RunAddFunction · 0.92
RemoveToolsFunction · 0.92

Calls 1

toolFilterFunction · 0.85

Tested by

no test coverage detected