summaryrefslogtreecommitdiff
path: root/internal/askcli/command_write.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-23 08:03:40 +0200
committerPaul Buetow <paul@buetow.org>2026-03-23 08:03:40 +0200
commitba929c035c7c74113d061c57cc5b500af0b20b74 (patch)
tree6555fd5e6b5589fe6c3d3b76b9cc33726dce7cdd /internal/askcli/command_write.go
parent8f2a9f110b10b721d40dab1ce13475b56bac6ee7 (diff)
fix: use uuid:<uuid> filter for start/stop/done/annotate/modify commands
Taskwarrior expects the filter before the action verb. Commands like 'task start <uuid>' are invalid — the UUID must be part of the filter: 'task uuid:<uuid> start'. All mutation commands now use this pattern consistently, matching how priority/tag/denotate already worked. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/askcli/command_write.go')
-rw-r--r--internal/askcli/command_write.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/internal/askcli/command_write.go b/internal/askcli/command_write.go
index c55bd95..b07ce3e 100644
--- a/internal/askcli/command_write.go
+++ b/internal/askcli/command_write.go
@@ -39,7 +39,7 @@ func (d Dispatcher) handleModify(ctx context.Context, args []string, stdout, std
}
modArgs := args[2:]
var outBuf bytes.Buffer
- code, err := d.runner.Run(ctx, append([]string{"modify", uuid}, modArgs...), nil, &outBuf, io.Discard)
+ code, err := d.runner.Run(ctx, append([]string{"uuid:" + uuid, "modify"}, modArgs...), nil, &outBuf, io.Discard)
if code != 0 {
return code, err
}
@@ -59,7 +59,7 @@ func (d Dispatcher) handleAnnotate(ctx context.Context, args []string, stdout, s
}
note := strings.Join(args[2:], " ")
var outBuf bytes.Buffer
- code, err := d.runner.Run(ctx, []string{"annotate", uuid, note}, nil, &outBuf, io.Discard)
+ code, err := d.runner.Run(ctx, []string{"uuid:" + uuid, "annotate", note}, nil, &outBuf, io.Discard)
if code != 0 {
return code, err
}
@@ -78,7 +78,9 @@ func (d Dispatcher) handleStart(ctx context.Context, args []string, stdout, stde
return 1, nil
}
var outBuf bytes.Buffer
- code, err := d.runner.Run(ctx, []string{"start", uuid}, nil, &outBuf, io.Discard)
+ // uuid:<uuid> is used as the filter so taskwarrior selects the exact task;
+ // the action verb follows the filter.
+ code, err := d.runner.Run(ctx, []string{"uuid:" + uuid, "start"}, nil, &outBuf, io.Discard)
if code != 0 {
return code, err
}
@@ -97,7 +99,7 @@ func (d Dispatcher) handleStop(ctx context.Context, args []string, stdout, stder
return 1, nil
}
var outBuf bytes.Buffer
- code, err := d.runner.Run(ctx, []string{"stop", uuid}, nil, &outBuf, io.Discard)
+ code, err := d.runner.Run(ctx, []string{"uuid:" + uuid, "stop"}, nil, &outBuf, io.Discard)
if code != 0 {
return code, err
}
@@ -116,7 +118,7 @@ func (d Dispatcher) handleDone(ctx context.Context, args []string, stdout, stder
return 1, nil
}
var outBuf bytes.Buffer
- code, err := d.runner.Run(ctx, []string{"done", uuid}, nil, &outBuf, io.Discard)
+ code, err := d.runner.Run(ctx, []string{"uuid:" + uuid, "done"}, nil, &outBuf, io.Discard)
if code != 0 {
return code, err
}