You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.9 KiB
1.9 KiB
| title | status | type | priority | created_at | updated_at |
|---|---|---|---|---|---|
| nbd archive command and Closed status | completed | feature | normal | 2026-03-10T23:30:29Z | 2026-03-10T23:30:29Z |
Add Status::Closed (serialised as "closed") and a convenience nbd archive <id> command that sets it.
Motivation
done tickets clutter nbd list. closed provides a soft-delete: the ticket is preserved on disk but excluded from normal listings by default.
Approach
ticket.rs
- Add
Closedvariant toStatusenum (afterDone). #[serde(rename_all = "snake_case")]already handles serialisation →"closed".
main.rs
- Update
parse_statusto accept"closed". - Update
status_strindisplay.rsto mapStatus::Closed→"closed". - Add
Archivevariant toCommands:Archive { id: String } - Implement
cmd_archive(id, json): read ticket → set status toClosed→ write → print. This is syntactic sugar fornbd update <id> --status closed.
display.rs
- Add
"closed"tostatus_strmatch arm.
list filtering
nbd listcurrently shows all tickets. After this change, it should by default hideClosedtickets.- Add a
--allflag tonbd listto show all tickets including closed ones. - Update
list_ticketsor filter at the command handler level. Prefer filtering incmd_listto keeplist_ticketsgeneric.
Tests
- Unit test:
Status::Closedserialises to"closed"and back. - Integration test:
nbd archive <id>sets status toclosed. - Integration test:
nbd listdoes not show closed tickets. - Integration test:
nbd list --allshows closed tickets.
Files touched
src/ticket.rs— addClosedvariantsrc/main.rs—Archivecommand,parse_statusupdate,--allflag onlistsrc/display.rs—status_strupdatesrc/tests.rs— unit teststests/integration.rs— integration testsREADME.md— document archive and --all