feat: add --sort and --reverse flags to bd search command

Added sorting capability to the search command, matching the behavior
already available in bd list. Supports sorting by: priority, created,
updated, closed, status, id, title, type, and assignee.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-24 20:43:51 -08:00
parent bad34e6ce8
commit 41c9c2df7f
2 changed files with 24 additions and 0 deletions

View File

@@ -33,6 +33,8 @@ Unlike `bd list`, which requires you to specify which field to search, `bd searc
- **--label, -l**: Filter by labels (must have ALL specified labels)
- **--label-any**: Filter by labels (must have AT LEAST ONE)
- **--limit, -n**: Limit number of results (default: 50)
- **--sort**: Sort by field: priority, created, updated, closed, status, id, title, type, assignee
- **--reverse, -r**: Reverse sort order
- **--long**: Show detailed multi-line output for each issue
- **--json**: Output results in JSON format
@@ -62,6 +64,18 @@ bd search refactor --assignee alice --type task
bd search bug --status open --limit 10
```
### Sorted Output
```bash
# Search bugs sorted by priority (P0 first)
bd search bug --sort priority
# Search features sorted by most recently updated
bd search feature --sort updated
# Search issues sorted by priority, lowest first
bd search refactor --sort priority --reverse
```
### JSON Output
```bash
# Get JSON results for programmatic use