| 532 | } |
| 533 | |
| 534 | func promptForJob(prompter shared.Prompter, cs *iostreams.ColorScheme, jobs []shared.Job) (*shared.Job, error) { |
| 535 | candidates := []string{"View all jobs in this run"} |
| 536 | for _, job := range jobs { |
| 537 | symbol, _ := shared.Symbol(cs, job.Status, job.Conclusion) |
| 538 | candidates = append(candidates, fmt.Sprintf("%s %s", symbol, job.Name)) |
| 539 | } |
| 540 | |
| 541 | selected, err := prompter.Select("View a specific job in this run?", "", candidates) |
| 542 | if err != nil { |
| 543 | return nil, err |
| 544 | } |
| 545 | |
| 546 | if selected > 0 { |
| 547 | return &jobs[selected-1], nil |
| 548 | } |
| 549 | |
| 550 | // User wants to see all jobs |
| 551 | return nil, nil |
| 552 | } |
| 553 | |
| 554 | func displayLogSegments(w io.Writer, segments []logSegment) error { |
| 555 | for _, segment := range segments { |