notesCell builds the trailing NOTES column in table output. Each fragment is colored independently so the row reads well at a glance. waitMax > 0 truncates the waiting field; 0 disables truncation (the --no-truncate path).
(p listfmt.Painter, r taskListRow, waitMax int)
| 525 | // truncates the waiting field; 0 disables truncation (the --no-truncate |
| 526 | // path). |
| 527 | func notesCell(p listfmt.Painter, r taskListRow, waitMax int) string { |
| 528 | var parts []string |
| 529 | if r.Stale { |
| 530 | parts = append(parts, p.Wrap(fmt.Sprintf("⚠ stale (%dd)", r.StaleDays), listfmt.Red)) |
| 531 | } |
| 532 | if r.WaitingOn != "" { |
| 533 | parts = append(parts, p.Wrap("[waiting: "+listfmt.Truncate(r.WaitingOn, waitMax)+"]", listfmt.Yellow)) |
| 534 | } |
| 535 | if r.Assignee != "" { |
| 536 | parts = append(parts, p.Wrap("[@"+r.Assignee+"]", listfmt.Blue)) |
| 537 | } |
| 538 | if r.Live { |
| 539 | parts = append(parts, p.Wrap("[live]", listfmt.Cyan)) |
| 540 | } |
| 541 | for _, t := range r.Tags { |
| 542 | parts = append(parts, p.Wrap("#"+t, listfmt.Gray)) |
| 543 | } |
| 544 | if r.Archived { |
| 545 | parts = append(parts, p.Wrap("(archived)", listfmt.Dim)) |
| 546 | } |
| 547 | return strings.Join(parts, " ") |
| 548 | } |
| 549 | |
| 550 | func listProjectsCmd(args []string) int { |
| 551 | fs := flagSet("list projects") |
no test coverage detected