| 557 | } |
| 558 | |
| 559 | func promptForJob(prompter shared.Prompter, cs *iostreams.ColorScheme, jobs []shared.Job) (*shared.Job, error) { |
| 560 | candidates := []string{"View all jobs in this run"} |
| 561 | for _, job := range jobs { |
| 562 | symbol, _ := shared.Symbol(cs, job.Status, job.Conclusion) |
| 563 | candidates = append(candidates, fmt.Sprintf("%s %s", symbol, job.Name)) |
| 564 | } |
| 565 | |
| 566 | selected, err := prompter.Select("View a specific job in this run?", "", candidates) |
| 567 | if err != nil { |
| 568 | return nil, err |
| 569 | } |
| 570 | |
| 571 | if selected > 0 { |
| 572 | return &jobs[selected-1], nil |
| 573 | } |
| 574 | |
| 575 | // User wants to see all jobs |
| 576 | return nil, nil |
| 577 | } |
| 578 | |
| 579 | func displayLogSegments(w io.Writer, segments []logSegment) error { |
| 580 | for _, segment := range segments { |