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.
vibed/nbd/.beans/nbd-8yn8--add-status-conven...

52 lines
1.4 KiB
Markdown

---
# nbd-8yn8
title: Add status convenience sub-commands (open, start, complete, close)
status: todo
type: feature
priority: normal
created_at: 2026-03-10T23:30:31Z
updated_at: 2026-03-10T23:30:31Z
---
## 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):
```rust
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:
1. Call `resolve_id` (supports partial IDs)
2. `find_ticket_path` + `detect_format` to preserve existing file format
3. `read_ticket`
4. Set `ticket.status` to the target status
5. `write_ticket` in the same format
6. 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.