From 00ff404454c3fc04e13e39992d6dd1200bad9191 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 22 Mar 2026 21:21:02 +0200 Subject: ask: default to list, add ask all for complete task visibility - ask (no args) now behaves like ask list (active tasks sorted by priority/urgency) - ask help: explicit help subcommand - ask all: shows ALL tasks including completed/deleted (uses status:any) - handleAll added in command_list.go, mirrors handleList with status:any - Updated tests: help tests use explicit 'ask help', all subcommand added to reachability test - Updated help text to document ask all --- internal/askcli/dispatch.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'internal/askcli/dispatch.go') diff --git a/internal/askcli/dispatch.go b/internal/askcli/dispatch.go index 6a99460..d24fec8 100644 --- a/internal/askcli/dispatch.go +++ b/internal/askcli/dispatch.go @@ -24,7 +24,7 @@ func NewDispatcher(runner Runner) *Dispatcher { func (d Dispatcher) Dispatch(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (int, error) { if len(args) == 0 { - return d.help(stdout) + return d.handleList(ctx, []string{"list"}, stdout, stderr) } subcommand := args[0] switch subcommand { @@ -36,6 +36,8 @@ func (d Dispatcher) Dispatch(ctx context.Context, args []string, stdin io.Reader return d.handleAdd(ctx, args, stdout, stderr) case "list": return d.handleList(ctx, args, stdout, stderr) + case "all": + return d.handleAll(ctx, args, stdout, stderr) case "dep": return d.handleDep(ctx, args, stdout, stderr) case "urgency": @@ -58,6 +60,8 @@ func (d Dispatcher) Dispatch(ctx context.Context, args []string, stdin io.Reader return d.handleDenotate(ctx, args, stdout, stderr) case "delete": return d.handleDelete(ctx, args, stdout, stderr) + case "help": + return d.help(stdout) default: return d.unknownCommand(stderr, subcommand) } @@ -67,7 +71,8 @@ func (d Dispatcher) help(w io.Writer) (int, error) { io.WriteString(w, "ask - task management CLI\n") io.WriteString(w, "\nSubcommands:\n") io.WriteString(w, " ask add \"description\" Create a new task\n") - io.WriteString(w, " ask list [filters] List tasks (UUID-only output)\n") + io.WriteString(w, " ask list [filters] List active tasks (default)\n") + io.WriteString(w, " ask all [filters] List all tasks including completed/deleted\n") io.WriteString(w, " ask info Show task details\n") io.WriteString(w, " ask annotate \"note\" Add annotation to task\n") io.WriteString(w, " ask start Start working on task\n") -- cgit v1.2.3