Skip to content

feat(rg): add max depth aliases - #1669

Merged
chaliy merged 1 commit into
mainfrom
2026-05-22-rg-depth-aliases
May 22, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-22-rg-depth-aliases

Conversation

@chaliy

@chaliy chaliy commented May 22, 2026

Copy link
Copy Markdown
Contributor

What

Add real-rg-compatible max-depth aliases for the rg builtin.

Why

Real rg accepts -d NUM, attached short forms like -d1, and --maxdepth as aliases for --max-depth. Bashkit only accepted --max-depth.

How

  • Parse -d, attached short -dNUM, combined short groups ending in dNUM, and --maxdepth.
  • Keep all forms wired to the existing recursive depth filter.
  • Add real-rg differential coverage for search output and --files output.
  • Update rg --help output assertions for the aliases.

Risk

  • Low
  • Scoped to rg option parsing and help text.

Checklist

  • Tests added or updated
  • Backward compatibility considered
  • cargo fmt && cargo test -p bashkit builtins::rg::tests -- --nocapture
  • just pre-pr

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 9cb7a56 Commit Preview URL May 22 2026, 09:58 AM

@chaliy
chaliy merged commit 4cb3d4e into main May 22, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-depth-aliases branch May 22, 2026 10:10
chaliy added a commit that referenced this pull request May 30, 2026
## What
Add real-rg-compatible max-depth aliases for the rg builtin.

## Why
Real rg accepts `-d NUM`, attached short forms like `-d1`, and
`--maxdepth` as aliases for `--max-depth`. Bashkit only accepted
`--max-depth`.

## How
- Parse `-d`, attached short `-dNUM`, combined short groups ending in
`dNUM`, and `--maxdepth`.
- Keep all forms wired to the existing recursive depth filter.
- Add real-rg differential coverage for search output and `--files`
output.
- Update `rg --help` output assertions for the aliases.

## Risk
- Low
- Scoped to rg option parsing and help text.

## Checklist
- [x] Tests added or updated
- [x] Backward compatibility considered
- [x] `cargo fmt && cargo test -p bashkit builtins::rg::tests --
--nocapture`
- [x] `just pre-pr`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant