From f1cc2adc3bbbf08c1c08444653d40cfb8f38c305 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 22 Mar 2026 22:29:49 +0200 Subject: ask: fix filter argument ordering for list/all/ready commands Filters like +tag must come before the 'export' action in task commands. Previously filters were appended after 'export' causing 'ask list +integrationtest' to fail. --- internal/askcli/command_list.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'internal/askcli/command_list.go') diff --git a/internal/askcli/command_list.go b/internal/askcli/command_list.go index 82b7ff5..64ec2fb 100644 --- a/internal/askcli/command_list.go +++ b/internal/askcli/command_list.go @@ -9,13 +9,14 @@ import ( ) func (d Dispatcher) handleList(ctx context.Context, args []string, stdout, stderr io.Writer) (int, error) { - filterArgs := []string{"status:pending", "export"} + filterArgs := []string{"status:pending"} for _, arg := range args[1:] { if strings.HasPrefix(arg, "limit:") || strings.HasPrefix(arg, "sort:") || strings.HasPrefix(arg, "+") || arg == "started" { filterArgs = append(filterArgs, arg) } } + filterArgs = append(filterArgs, "export") var outBuf bytes.Buffer code, err := d.runner.Run(ctx, filterArgs, nil, &outBuf, stderr) if code != 0 { @@ -38,13 +39,14 @@ func (d Dispatcher) handleList(ctx context.Context, args []string, stdout, stder } func (d Dispatcher) handleAll(ctx context.Context, args []string, stdout, stderr io.Writer) (int, error) { - filterArgs := []string{"export"} + filterArgs := []string{} for _, arg := range args[1:] { if strings.HasPrefix(arg, "limit:") || strings.HasPrefix(arg, "sort:") || strings.HasPrefix(arg, "+") || arg == "started" { filterArgs = append(filterArgs, arg) } } + filterArgs = append(filterArgs, "export") var outBuf bytes.Buffer code, err := d.runner.Run(ctx, filterArgs, nil, &outBuf, stderr) if code != 0 { @@ -67,13 +69,14 @@ func (d Dispatcher) handleAll(ctx context.Context, args []string, stdout, stderr } func (d Dispatcher) handleReady(ctx context.Context, args []string, stdout, stderr io.Writer) (int, error) { - filterArgs := []string{"+READY", "export"} + filterArgs := []string{"+READY"} for _, arg := range args[1:] { if strings.HasPrefix(arg, "limit:") || strings.HasPrefix(arg, "sort:") || strings.HasPrefix(arg, "+") || arg == "started" { filterArgs = append(filterArgs, arg) } } + filterArgs = append(filterArgs, "export") var outBuf bytes.Buffer code, err := d.runner.Run(ctx, filterArgs, nil, &outBuf, stderr) if code != 0 { -- cgit v1.2.3