1.5 KiB
+++ title = "Add list status sub-commands (list todo, list backlog, etc.)" priority = 4 status = "todo" ticket_type = "feature" dependencies = [] +++
Problem
Filtering by status requires the verbose --filter status=X. Common patterns like listing only backlog or only completed tickets should have ergonomic shortcuts.
Sub-commands to add (positional arg to list)
Accept an optional positional <status> argument to nbd list:
nbd list backlog # equivalent to: nbd list --filter status=backlog
nbd list closed # equivalent to: nbd list --filter status=closed
nbd list completed # equivalent to: nbd list --filter status=done
nbd list todo # equivalent to: nbd list --filter status=todo
nbd list in_progress # equivalent to: nbd list --filter status=in_progress
Note: completed is an alias for done (avoids the awkward nbd list done).
Implementation
src/main.rs — Commands::List
Add an optional positional argument status to the List variant:
List {
status: Option<String>, // new: positional shorthand
filter: Vec<String>,
all: bool,
}
In cmd_list, when status is Some(s):
- Map
"completed"" → "done", others pass through - Treat it as if the caller had passed
--filter status=<s> - The explicit
--filterand--allflags should still override as today
If both status and --filter status=... are given, merge them (OR behaviour within the status group, consistent with TicketFilter).
tests/integration.rs
Add tests for each status shorthand.