diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-27 06:46:28 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-27 06:46:28 +0200 |
| commit | 426b836d03078a5e438319d0d2a90d9d2a93430b (patch) | |
| tree | 1d19144a3b035442de35ac1869476ab22129bf75 /internal | |
| parent | 21c1d5c9cc4974ba490b329acae735ff6bde9973 (diff) | |
fix askcli header width for 0685342b-606c-4c8f-aab5-cd363d926e77
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/askcli/formatter.go | 4 | ||||
| -rw-r--r-- | internal/askcli/formatter_test.go | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/internal/askcli/formatter.go b/internal/askcli/formatter.go index 7ca9225..9e3c245 100644 --- a/internal/askcli/formatter.go +++ b/internal/askcli/formatter.go @@ -31,7 +31,7 @@ type taskListWidths struct { func taskListWidthsFor(tasks []TaskExport, aliases map[string]string) taskListWidths { widths := taskListWidths{ Urgency: len("Urgency"), - Priority: len("Priority"), + Priority: len("Prio"), ID: len("ID"), Status: len("Status"), Started: len("Started"), @@ -53,7 +53,7 @@ func taskListWidthsFor(tasks []TaskExport, aliases map[string]string) taskListWi func writeTaskListHeader(b *strings.Builder, widths taskListWidths) { fmt.Fprintf(b, "%-*s | %-*s | %-*s | %-*s | %-*s | %-*s | %-*s\n", widths.Urgency, "Urgency", - widths.Priority, "Priority", + widths.Priority, "Prio", widths.ID, "ID", widths.Status, "Status", widths.Started, "Started", diff --git a/internal/askcli/formatter_test.go b/internal/askcli/formatter_test.go index c99effd..1d2a22e 100644 --- a/internal/askcli/formatter_test.go +++ b/internal/askcli/formatter_test.go @@ -18,8 +18,11 @@ func TestFormatTaskList(t *testing.T) { if len(lines) < 3 { t.Fatalf("FormatTaskList produced too few lines: %d", len(lines)) } - if !strings.Contains(lines[0], "ID") || !strings.Contains(lines[0], "Priority") { - t.Fatalf("header missing ID or Priority column: %s", lines[0]) + if !strings.Contains(lines[0], "ID") || !strings.Contains(lines[0], "Prio") { + t.Fatalf("header missing ID or Prio column: %s", lines[0]) + } + if strings.Contains(lines[0], "Priority") { + t.Fatalf("header should use compact Prio label: %s", lines[0]) } if !strings.Contains(lines[0], "Started") { t.Fatalf("header missing Started column: %s", lines[0]) @@ -62,7 +65,7 @@ func TestFormatTaskList_AlignsHeaderAndSeparator(t *testing.T) { widths := taskListWidthsFor(tasks, aliases) wantHeader := fmt.Sprintf("%-*s | %-*s | %-*s | %-*s | %-*s | %-*s | %-*s", widths.Urgency, "Urgency", - widths.Priority, "Priority", + widths.Priority, "Prio", widths.ID, "ID", widths.Status, "Status", widths.Started, "Started", |
