(out io.Writer, tool tools.Tool, ep providers.Endpoint, model string, plan []tools.PlannedWrite, args []string)
| 257 | } |
| 258 | |
| 259 | func printDryRun(out io.Writer, tool tools.Tool, ep providers.Endpoint, model string, plan []tools.PlannedWrite, args []string) { |
| 260 | fmt.Fprintf(out, "Tool: %s\n", tool.LaunchCommand()) |
| 261 | if ep.Endpoint != "" { |
| 262 | fmt.Fprintf(out, "Endpoint: %s\n", ep.Endpoint) |
| 263 | } |
| 264 | if model != "" { |
| 265 | fmt.Fprintf(out, "Model: %s\n", model) |
| 266 | } |
| 267 | if tool.ConfigTarget != nil && len(plan) > 0 { |
| 268 | fmt.Fprintf(out, "Config writes (%s):\n", tool.ConfigTarget.Path) |
| 269 | for _, p := range plan { |
| 270 | v := p.Value |
| 271 | keyU := strings.ToUpper(p.KeyPath) |
| 272 | if s, ok := v.(string); ok && (strings.Contains(keyU, "AUTH") || strings.Contains(keyU, "KEY") || strings.Contains(keyU, "TOKEN")) { |
| 273 | v = providers.MaskedAPIKey(s) |
| 274 | } |
| 275 | fmt.Fprintf(out, " %s %s = %q\n", p.Op, p.KeyPath, fmt.Sprintf("%v", v)) |
| 276 | } |
| 277 | } |
| 278 | if len(args) > 0 { |
| 279 | fmt.Fprintf(out, "Args: %s\n", strings.Join(args, " ")) |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | // runToolMenu remains as a fallback used by tests that exercise the |
| 284 | // non-TTY rendering path of the legacy single-step menu. It is no |
no test coverage detected