From 1433f7a13ede0c819ec4f8fd4027ad3df8daa94f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 5 Jun 2026 10:26:16 +0300 Subject: Add 'ask edit' subcommand and collapse multi-line task descriptions - ask edit opens $EDITOR and creates a task from the (multi-line) content, reusing the shared internal/editor package - collapse newlines in list output and fish completion so multi-line descriptions render on one line and don't break completion Bump version to 0.40.0 Amp-Thread-ID: https://ampcode.com/threads/T-019e96a1-9c8e-73d6-95b4-b55cb12cc762 Co-authored-by: Amp --- internal/askcli/command_add.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/askcli/command_add.go') diff --git a/internal/askcli/command_add.go b/internal/askcli/command_add.go index 096046d..ccfb034 100644 --- a/internal/askcli/command_add.go +++ b/internal/askcli/command_add.go @@ -27,6 +27,12 @@ func (d *Dispatcher) handleAdd(ctx context.Context, args []string, stdout, stder writeInfoError(stderr, err) return code, nil } + return d.createTask(ctx, modifiers, description, dependencyUUIDs, stdout, stderr) +} + +// createTask creates a Taskwarrior task from the given modifiers, description, +// and resolved dependency UUIDs, assigns an alias, and prints the created task. +func (d *Dispatcher) createTask(ctx context.Context, modifiers []string, description string, dependencyUUIDs []string, stdout, stderr io.Writer) (int, error) { var outBuf bytes.Buffer // rc.verbose=nothing keeps Taskwarrior quiet by default. rc.verbose=new-uuid // then re-enables the UUID-only confirmation we parse below. @@ -36,7 +42,7 @@ func (d *Dispatcher) handleAdd(ctx context.Context, args []string, stdout, stder taskArgs = append(taskArgs, "depends:"+strings.Join(dependencyUUIDs, ",")) } taskArgs = append(taskArgs, description) - code, err = d.runner.Run(ctx, taskArgs, nil, &outBuf, stderr) + code, err := d.runner.Run(ctx, taskArgs, nil, &outBuf, stderr) if code != 0 { return code, err } -- cgit v1.2.3