summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd/ask/askbin0 -> 3528033 bytes
-rw-r--r--internal/askcli/command_list.go2
-rw-r--r--internal/askcli/command_list_test.go32
-rw-r--r--internal/version.go2
4 files changed, 26 insertions, 10 deletions
diff --git a/cmd/ask/ask b/cmd/ask/ask
new file mode 100755
index 0000000..9990730
--- /dev/null
+++ b/cmd/ask/ask
Binary files differ
diff --git a/internal/askcli/command_list.go b/internal/askcli/command_list.go
index b5c5429..82b7ff5 100644
--- a/internal/askcli/command_list.go
+++ b/internal/askcli/command_list.go
@@ -9,7 +9,7 @@ import (
)
func (d Dispatcher) handleList(ctx context.Context, args []string, stdout, stderr io.Writer) (int, error) {
- filterArgs := []string{"export"}
+ filterArgs := []string{"status:pending", "export"}
for _, arg := range args[1:] {
if strings.HasPrefix(arg, "limit:") || strings.HasPrefix(arg, "sort:") ||
strings.HasPrefix(arg, "+") || arg == "started" {
diff --git a/internal/askcli/command_list_test.go b/internal/askcli/command_list_test.go
index 745a402..e6bce83 100644
--- a/internal/askcli/command_list_test.go
+++ b/internal/askcli/command_list_test.go
@@ -11,8 +11,11 @@ import (
func TestHandleList_Success(t *testing.T) {
jsonData := `[{"uuid":"uuid-1","description":"Task 1","status":"pending","priority":"H","tags":["cli"],"urgency":15.0,"depends":[]},{"uuid":"uuid-2","description":"Task 2","status":"completed","priority":"M","tags":["agent"],"urgency":10.0,"depends":[]}]`
d := NewDispatcher(&spyRunner{runFn: func(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (int, error) {
- if args[0] == "export" {
- io.WriteString(stdout, jsonData)
+ for _, arg := range args {
+ if arg == "export" {
+ io.WriteString(stdout, jsonData)
+ return 0, nil
+ }
}
return 0, nil
}})
@@ -30,8 +33,11 @@ func TestHandleList_Success(t *testing.T) {
func TestHandleList_SortedByPriority(t *testing.T) {
jsonData := `[{"uuid":"uuid-2","description":"Task 2","status":"pending","priority":"M","tags":[],"urgency":10.0,"depends":[]},{"uuid":"uuid-1","description":"Task 1","status":"pending","priority":"H","tags":[],"urgency":5.0,"depends":[]}]`
d := NewDispatcher(&spyRunner{runFn: func(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (int, error) {
- if args[0] == "export" {
- io.WriteString(stdout, jsonData)
+ for _, arg := range args {
+ if arg == "export" {
+ io.WriteString(stdout, jsonData)
+ return 0, nil
+ }
}
return 0, nil
}})
@@ -47,8 +53,11 @@ func TestHandleList_SortedByPriority(t *testing.T) {
func TestHandleList_EmptyList(t *testing.T) {
d := NewDispatcher(&spyRunner{runFn: func(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (int, error) {
- if args[0] == "export" {
- io.WriteString(stdout, "[]")
+ for _, arg := range args {
+ if arg == "export" {
+ io.WriteString(stdout, "[]")
+ return 0, nil
+ }
}
return 0, nil
}})
@@ -71,7 +80,14 @@ func TestHandleList_PassesFilters(t *testing.T) {
if len(capturedArgs) < 2 {
t.Fatalf("expected export args, got %v", capturedArgs)
}
- if capturedArgs[0] != "export" {
- t.Fatalf("first arg should be export, got %s", capturedArgs[0])
+ hasExport := false
+ for _, arg := range capturedArgs {
+ if arg == "export" {
+ hasExport = true
+ break
+ }
+ }
+ if !hasExport {
+ t.Fatalf("expected export in args, got %v", capturedArgs)
}
}
diff --git a/internal/version.go b/internal/version.go
index fa765e6..b73ef9e 100644
--- a/internal/version.go
+++ b/internal/version.go
@@ -1,4 +1,4 @@
// Package internal provides the Hexai semantic version identifier used by CLI and LSP binaries.
package internal
-const Version = "0.25.2"
+const Version = "0.25.3"