summaryrefslogtreecommitdiff
path: root/internal/askcli
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-26 22:21:34 +0200
committerPaul Buetow <paul@buetow.org>2026-03-26 22:21:34 +0200
commit9dc8c5e241af77fd61c1da91e0fe49faa5cf06e4 (patch)
tree72388ce9cf8301184aea0841ca9b8e980b06e2a8 /internal/askcli
parentf6436fe4cfdd989d95607931314a7c47147ee1e2 (diff)
ask: filter fish UUID completion
Diffstat (limited to 'internal/askcli')
-rw-r--r--internal/askcli/completion.go2
-rw-r--r--internal/askcli/completion_test.go2
2 files changed, 2 insertions, 2 deletions
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'",