cmdViewOutput shows a previously captured output in the pager.
(renderer *agent.UIRenderer, outputs []*CommandOutput, answer string)
| 404 | |
| 405 | // cmdViewOutput shows a previously captured output in the pager. |
| 406 | func (a *AgentMode) cmdViewOutput(renderer *agent.UIRenderer, outputs []*CommandOutput, answer string) { |
| 407 | nStr := strings.TrimPrefix(answer, "v") |
| 408 | n, err := strconv.Atoi(nStr) |
| 409 | if err != nil || n < 1 || n > len(outputs) || outputs[n-1] == nil { |
| 410 | fmt.Println(i18n.T("agent.status.no_output_to_show")) |
| 411 | _ = a.getInput(renderer.Colorize(i18n.T("agent.status.press_enter"), agent.ColorGray)) |
| 412 | return |
| 413 | } |
| 414 | _ = renderer.ShowInPager(outputs[n-1].Output) |
| 415 | } |
| 416 | |
| 417 | // cmdSaveOutput writes a previously captured output to a temp log file. |
| 418 | func (a *AgentMode) cmdSaveOutput(renderer *agent.UIRenderer, outputs []*CommandOutput, answer string) { |
no test coverage detected