From bc0849e96fe41e509af4306c0953f463a7fad155 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 23 Mar 2026 13:35:07 +0200 Subject: fix: accept uuid: prefix on all ask subcommands via NormalizeUUID All ask commands now strip a leading "uuid:" prefix from user-supplied UUID arguments before building the taskwarrior filter, so both bare UUIDs and the "uuid:" format work uniformly across annotate, start, stop, done, modify, denotate, priority, tag, info, delete, and dep. Co-Authored-By: Claude Sonnet 4.6 --- internal/askcli/formatter_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'internal/askcli/formatter_test.go') diff --git a/internal/askcli/formatter_test.go b/internal/askcli/formatter_test.go index 394ea91..50d6ae3 100644 --- a/internal/askcli/formatter_test.go +++ b/internal/askcli/formatter_test.go @@ -106,6 +106,25 @@ func TestIsNumericID(t *testing.T) { } } +func TestNormalizeUUID(t *testing.T) { + cases := []struct { + input string + want string + }{ + {"fc390139-cc08-413f-a411-f2feae4875a3", "fc390139-cc08-413f-a411-f2feae4875a3"}, + {"uuid:fc390139-cc08-413f-a411-f2feae4875a3", "fc390139-cc08-413f-a411-f2feae4875a3"}, + {"fc390139", "fc390139"}, + {"uuid:fc390139", "fc390139"}, + {"", ""}, + } + for _, c := range cases { + got := NormalizeUUID(c.input) + if got != c.want { + t.Errorf("NormalizeUUID(%q) = %q, want %q", c.input, got, c.want) + } + } +} + func TestRejectNumericID(t *testing.T) { output := RejectNumericID() if !strings.Contains(output, "use UUID") { -- cgit v1.2.3