summaryrefslogtreecommitdiff
path: root/internal/askcli/dispatch_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-07 09:06:35 +0300
committerPaul Buetow <paul@buetow.org>2026-04-07 09:06:35 +0300
commit4185a422395bfe9d40c6f934fd56663d223bf782 (patch)
tree824096882989869fd65643b45c49a6c5bae11b00 /internal/askcli/dispatch_test.go
parent627485ecf12991c08340c69c999a117dfb24eebb (diff)
feat: show task summary in fish shell autocompletion for alias IDsv0.29.0
The complete-uuids command now emits tab-separated "selector\tdescription" lines so fish shell displays the first 60 chars of the task description alongside each alias/UUID in the autocompletion menu. The __ask_add_dependency_modifiers fish function is updated to strip the description field before matching and building depends: completions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/askcli/dispatch_test.go')
-rw-r--r--internal/askcli/dispatch_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/askcli/dispatch_test.go b/internal/askcli/dispatch_test.go
index 079d156..e027b43 100644
--- a/internal/askcli/dispatch_test.go
+++ b/internal/askcli/dispatch_test.go
@@ -73,7 +73,7 @@ func TestDispatcher_CompleteUUIDsSubcommand(t *testing.T) {
if strings.Join(args, " ") != "status:pending export" {
t.Fatalf("args = %v, want pending export", args)
}
- _, _ = io.WriteString(stdout, `[{"uuid":"uuid-1"}]`)
+ _, _ = io.WriteString(stdout, `[{"uuid":"uuid-1","description":"Sample task"}]`)
return 0, nil
}})
var stdout, stderr bytes.Buffer
@@ -84,8 +84,9 @@ func TestDispatcher_CompleteUUIDsSubcommand(t *testing.T) {
if code != 0 {
t.Fatalf("complete-uuids code = %d, want 0", code)
}
- if got := stdout.String(); got != "0\nuuid-1\n" {
- t.Fatalf("stdout = %q, want selector list", got)
+ // Output is "selector\tdescription" for fish shell autocompletion display.
+ if got := stdout.String(); got != "0\tSample task\nuuid-1\tSample task\n" {
+ t.Fatalf("stdout = %q, want tab-separated selector list", got)
}
}