ResolveToolAliases resolves deprecated tool aliases to their canonical names. It logs a warning to stderr for each deprecated alias that is resolved. Returns: - resolved: tool names with aliases replaced by canonical names - aliasesUsed: map of oldName → newName for each alias that was resolved
(toolNames []string)
| 264 | // - resolved: tool names with aliases replaced by canonical names |
| 265 | // - aliasesUsed: map of oldName → newName for each alias that was resolved |
| 266 | func (r *Inventory) ResolveToolAliases(toolNames []string) (resolved []string, aliasesUsed map[string]string) { |
| 267 | resolved = make([]string, 0, len(toolNames)) |
| 268 | aliasesUsed = make(map[string]string) |
| 269 | for _, toolName := range toolNames { |
| 270 | if canonicalName, isAlias := r.deprecatedAliases[toolName]; isAlias { |
| 271 | fmt.Fprintf(os.Stderr, "Warning: tool %q is deprecated, use %q instead\n", toolName, canonicalName) |
| 272 | aliasesUsed[toolName] = canonicalName |
| 273 | resolved = append(resolved, canonicalName) |
| 274 | } else { |
| 275 | resolved = append(resolved, toolName) |
| 276 | } |
| 277 | } |
| 278 | return resolved, aliasesUsed |
| 279 | } |
| 280 | |
| 281 | // FindToolByName searches all tools for one matching the given name. |
| 282 | // Returns the tool, its toolset ID, and an error if not found. |
no outgoing calls