summaryrefslogtreecommitdiff
path: root/cmd/ask
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-23 07:41:07 +0200
committerPaul Buetow <paul@buetow.org>2026-03-23 07:41:07 +0200
commit77a38b42f47e8842e5c60673f9b25e3871cf8d8e (patch)
treee886cb0e4cd333c62f1fe9ab00661bacf719e611 /cmd/ask
parent987c08b9bd86f4e6afabfb3dcb0efaf98f1ccb38 (diff)
ask add: always emit UUID, never the numeric task ID
Use rc.verbose=new-uuid so taskwarrior prints "Created task <uuid>." directly on stdout. Parse the UUID from that line instead of doing a two-step numeric-ID lookup or falling back to an export call. Removes ExtractUUIDFromOutput (which could leak numeric IDs) and fetchUUIDByNumericID (the export fallback). Integration tests now get the UUID straight from ask add output without any extra calls. Also fixes TestMain_WiresDispatcher which expected "export" first in args, but list now prepends status:pending filter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'cmd/ask')
-rw-r--r--cmd/ask/main_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/ask/main_test.go b/cmd/ask/main_test.go
index f91afbd..db6b436 100644
--- a/cmd/ask/main_test.go
+++ b/cmd/ask/main_test.go
@@ -25,8 +25,8 @@ func TestMain_WiresDispatcher(t *testing.T) {
if code != 0 {
t.Fatalf("exitCode = %d, want 0", code)
}
- if len(gotArgs) < 2 || gotArgs[0] != "export" {
- t.Fatalf("args = %v, want [export, ...]", gotArgs)
+ if len(gotArgs) < 1 || gotArgs[len(gotArgs)-1] != "export" {
+ t.Fatalf("args = %v, want [..., export]", gotArgs)
}
}