summaryrefslogtreecommitdiff
path: root/internal/askcli/command_urgency.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/askcli/command_urgency.go')
-rw-r--r--internal/askcli/command_urgency.go19
1 files changed, 1 insertions, 18 deletions
diff --git a/internal/askcli/command_urgency.go b/internal/askcli/command_urgency.go
index a6f545c..9911f42 100644
--- a/internal/askcli/command_urgency.go
+++ b/internal/askcli/command_urgency.go
@@ -3,7 +3,6 @@ package askcli
import (
"bytes"
"context"
- "encoding/json"
"fmt"
"io"
"sort"
@@ -23,21 +22,5 @@ func (d *Dispatcher) handleUrgency(ctx context.Context, stdout, stderr io.Writer
sort.Slice(tasks, func(i, j int) bool {
return tasks[i].Urgency > tasks[j].Urgency
})
- if d.jsonOutput {
- data, err := json.Marshal(tasks)
- if err != nil {
- fmt.Fprintf(stderr, "error: failed to marshal JSON: %v\n", err)
- return 1, nil
- }
- stdout.Write(data)
- io.WriteString(stdout, "\n")
- } else {
- aliases, err := ensureTaskAliases(tasks)
- if err != nil {
- fmt.Fprintf(stderr, "error: failed to load task aliases: %v\n", err)
- return 1, nil
- }
- io.WriteString(stdout, FormatTaskListForWidth(tasks, aliases, detectTaskListTerminalWidth(stdout)))
- }
- return 0, nil
+ return renderTaskList(tasks, stdout, stderr, d.jsonOutput)
}