From 9dc8c5e241af77fd61c1da91e0fe49faa5cf06e4 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 26 Mar 2026 22:21:34 +0200 Subject: ask: filter fish UUID completion --- internal/askcli/completion.go | 2 +- internal/askcli/completion_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/askcli') diff --git a/internal/askcli/completion.go b/internal/askcli/completion.go index 28ad306..e947495 100644 --- a/internal/askcli/completion.go +++ b/internal/askcli/completion.go @@ -189,7 +189,7 @@ func writeFishDepUUIDContextFunction(b *strings.Builder) { func writeFishTaskUUIDFunction(b *strings.Builder) { b.WriteString("function __ask_task_uuids\n") - b.WriteString(" command ask all --json 2>/dev/null | string match -r -a -g '\"uuid\":\"([^\"]+)\"'\n") + b.WriteString(" command ask all --json 2>/dev/null | jq -r '.[] | select(.status != \"completed\" and .status != \"deleted\") | .uuid' 2>/dev/null\n") b.WriteString("end\n\n") } diff --git a/internal/askcli/completion_test.go b/internal/askcli/completion_test.go index 439e483..52cdce8 100644 --- a/internal/askcli/completion_test.go +++ b/internal/askcli/completion_test.go @@ -36,7 +36,7 @@ func TestFishCompletion_IncludesCommandsAndExcludesExport(t *testing.T) { "complete -c ask -n '__ask_in_dep_context' -a 'rm' -d 'Remove a dependency'", "complete -c ask -n '__ask_in_dep_context' -a 'list' -d 'List dependencies'", "function __ask_task_uuids", - "command ask all --json 2>/dev/null", + "command ask all --json 2>/dev/null | jq -r '.[] | select(.status != \"completed\" and .status != \"deleted\") | .uuid' 2>/dev/null", "complete -c ask -n '__ask_in_uuid_context' -a '(__ask_task_uuids)' -d 'Show task details'", "complete -c ask -n '__ask_in_dep_uuid_context' -a '(__ask_task_uuids)' -d 'Add a dependency'", "complete -c ask -n '__ask_in_dep_uuid_context' -a '(__ask_task_uuids)' -d 'Remove a dependency'", -- cgit v1.2.3