Skip to content

feat(search): --stats and SearchStats counters#3

Merged
botirk38 merged 1 commit intomasterfrom
phase-4
Apr 3, 2026
Merged

feat(search): --stats and SearchStats counters#3
botirk38 merged 1 commit intomasterfrom
phase-4

Conversation

@botirk38
Copy link
Copy Markdown
Owner

@botirk38 botirk38 commented Apr 3, 2026

Summary

Adds ripgrep-style --stats: after a search, prints two lines to stderr (N matches, M files searched).

Core

  • New SearchStats with files_searched and mode-dependent matches.
  • CompiledSearch::run_index_with_stats / run_walk_with_stats fill &mut SearchStats; existing run_index / run_walk unchanged.

CLI

  • --stats + argv resolver; StatsDecl for --help.

Tests / docs

  • crates/cli/tests/integration_stats.rs
  • docs/rg-compat-matrix.md updates (stats row; context/heading/color notes).

Validation

cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, cargo test --workspace --all-features.

- Add SearchStats (files_searched, matches) and run_index_with_stats /
  run_walk_with_stats on CompiledSearch
- Accumulate line matches in standard modes; summary_modes use mode-specific tallies
- CLI: --stats prints match and file counts to stderr; argv resolver + StatsDecl for help
- Integration test integration_stats; refresh rg-compat-matrix rows for stats/context/heading/color
@botirk38 botirk38 merged commit 64be599 into master Apr 3, 2026
4 checks passed
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