feat: implement --max-depth flag for bd dep tree (closes #87, bd-3, bd-159)

- Add --max-depth/-d flag with default of 50
- Wire flag through to store.GetDependencyTree()
- Add input validation (must be >= 1)
- Show inline '… [truncated]' markers on truncated nodes
- Update truncation warning to show actual depth used
- Add comprehensive tests (truncation, default depth, boundary cases)
- Update CLI docs and reference

Thanks to @yashwanth-reddy909 for the initial implementation in PR #87.
This commit completes the feature with full wiring, validation, tests, and docs.

Amp-Thread-ID: https://ampcode.com/threads/T-c439b09c-cff2-48d9-8988-cf9353f0d32e
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-19 09:00:11 -07:00
parent 22daa12665
commit b0fba2eef2
5 changed files with 180 additions and 6 deletions

View File

@@ -185,9 +185,13 @@ Visualize full dependency tree for an issue.
```bash
bd dep tree issue-123
# Limit tree depth (default: 50)
bd dep tree issue-123 --max-depth 10
bd dep tree issue-123 -d 10
```
Shows all dependencies and dependents in tree format.
Shows all dependencies and dependents in tree format. Use `--max-depth` to limit traversal depth for very deep trees.
---