Make ls status non-flag argument
This commit is contained in:
@@ -60,7 +60,6 @@ parameters:
|
|||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
description: "Filter by status (backlog, committed, reviewing, done)"
|
description: "Filter by status (backlog, committed, reviewing, done)"
|
||||||
cli_flag: "--status"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Example adding a ticket:
|
Example adding a ticket:
|
||||||
@@ -93,7 +92,7 @@ Example listing tickets:
|
|||||||
input:
|
input:
|
||||||
status: "backlog"
|
status: "backlog"
|
||||||
output: >
|
output: >
|
||||||
worklane ls --status backlog
|
worklane ls backlog
|
||||||
```
|
```
|
||||||
|
|
||||||
Example listing all tickets (no filter):
|
Example listing all tickets (no filter):
|
||||||
@@ -168,7 +167,7 @@ When creating a Worklane ticket, the agent MUST:
|
|||||||
The `worklane ls` command lists tickets. Use it to check the state of tickets:
|
The `worklane ls` command lists tickets. Use it to check the state of tickets:
|
||||||
|
|
||||||
* `worklane ls` — lists all tickets grouped by status without filtering
|
* `worklane ls` — lists all tickets grouped by status without filtering
|
||||||
* `worklane ls --status <STATUS>` — filters tickets by status
|
* `worklane ls <STATUS>` — filters tickets by status
|
||||||
|
|
||||||
Valid statuses: `backlog`, `committed`, `reviewing`, `done`
|
Valid statuses: `backlog`, `committed`, `reviewing`, `done`
|
||||||
|
|
||||||
@@ -177,5 +176,5 @@ Valid statuses: `backlog`, `committed`, `reviewing`, `done`
|
|||||||
When checking ticket status or filtering work, use `worklane ls` rather than reading from file paths directly. This ensures consistent access to ticket data.
|
When checking ticket status or filtering work, use `worklane ls` rather than reading from file paths directly. This ensures consistent access to ticket data.
|
||||||
|
|
||||||
Example patterns:
|
Example patterns:
|
||||||
* Check backlog items: `worklane ls --status backlog`
|
* Check backlog items: `worklane ls backlog`
|
||||||
* View all tickets: `worklane ls`
|
* View all tickets: `worklane ls`
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ pub enum Command {
|
|||||||
/// List tickets, optionally filtered by status
|
/// List tickets, optionally filtered by status
|
||||||
Ls {
|
Ls {
|
||||||
/// Filter by status (backlog, committed, reviewing, done)
|
/// Filter by status (backlog, committed, reviewing, done)
|
||||||
#[arg(long)]
|
|
||||||
status: Option<String>,
|
status: Option<String>,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
+6
-8
@@ -94,9 +94,7 @@ fn ls_with_status_filters_tickets() {
|
|||||||
create_ticket(&worklane, "reviewing", "Feature C", "charlie", "2026-08-01");
|
create_ticket(&worklane, "reviewing", "Feature C", "charlie", "2026-08-01");
|
||||||
|
|
||||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||||
cmd.current_dir(&temp.path())
|
cmd.current_dir(&temp.path()).arg("ls").args(["committed"]);
|
||||||
.arg("ls")
|
|
||||||
.args(["--status", "committed"]);
|
|
||||||
|
|
||||||
cmd.assert().success();
|
cmd.assert().success();
|
||||||
|
|
||||||
@@ -111,7 +109,7 @@ fn ls_with_invalid_status_fails() {
|
|||||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||||
cmd.current_dir(&temp.path())
|
cmd.current_dir(&temp.path())
|
||||||
.arg("ls")
|
.arg("ls")
|
||||||
.args(["--status", "nonexistent"])
|
.args(["nonexistent"])
|
||||||
.assert()
|
.assert()
|
||||||
.failure();
|
.failure();
|
||||||
}
|
}
|
||||||
@@ -128,7 +126,7 @@ fn ls_listed_tickets_sorted_alphabetically() {
|
|||||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||||
cmd.current_dir(&temp.path())
|
cmd.current_dir(&temp.path())
|
||||||
.arg("ls")
|
.arg("ls")
|
||||||
.args(["--status", "backlog"])
|
.args(["backlog"])
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
@@ -144,13 +142,13 @@ fn ls_listed_tickets_sorted_alphabetically() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn ls_empty_status_shows_message() {
|
fn ls_empty_status_shows_message() {
|
||||||
let temp = TempDir::new().unwrap();
|
let temp = TempDir::new().unwrap();
|
||||||
let worklane = setup_worklane(&temp);
|
let _worklane = setup_worklane(&temp);
|
||||||
|
|
||||||
// Intentionally leave "done" empty
|
// Intentionally leave "done" empty
|
||||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||||
cmd.current_dir(&temp.path())
|
cmd.current_dir(&temp.path())
|
||||||
.arg("ls")
|
.arg("ls")
|
||||||
.args(["--status", "done"])
|
.args(["done"])
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
@@ -168,7 +166,7 @@ fn ls_displays_owner_and_due() {
|
|||||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||||
cmd.current_dir(&temp.path())
|
cmd.current_dir(&temp.path())
|
||||||
.arg("ls")
|
.arg("ls")
|
||||||
.args(["--status", "backlog"])
|
.args(["backlog"])
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user