From 77a38b42f47e8842e5c60673f9b25e3871cf8d8e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 23 Mar 2026 07:41:07 +0200 Subject: ask add: always emit UUID, never the numeric task ID Use rc.verbose=new-uuid so taskwarrior prints "Created task ." 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 --- cmd/ask/main_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/ask') 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) } } -- cgit v1.2.3