1.4 KiB
+++ title = "Add status convenience sub-commands (open, start, complete, close)" priority = 5 status = "todo" ticket_type = "feature" dependencies = [] +++
Problem
nbd update <id> --status <x> is verbose for the most common lifecycle transitions. nbd archive already exists as a top-level convenience — the same pattern should apply to all transitions.
Sub-commands to add
| Command | Status set |
|---|---|
nbd open <id> |
todo |
nbd start <id> |
in_progress |
nbd complete <id> |
done |
nbd close <id> |
closed |
(nbd archive already exists — do not duplicate it.)
Implementation
src/main.rs
Add four variants to the Commands enum, following the existing Archive pattern (line 183):
Open { id: String },
Start { id: String },
Complete { id: String },
Close { id: String },
Add handler functions cmd_open, cmd_start, cmd_complete, cmd_close. Each handler should:
- Call
resolve_id(supports partial IDs) find_ticket_path+detect_formatto preserve existing file formatread_ticket- Set
ticket.statusto the target status write_ticketin the same format- Print the ticket (tabular or JSON via
--json)
Wire up in dispatch() following the same pattern as Commands::Archive.
tests/integration.rs
Add integration tests for each command analogous to the existing archive test.