Skip to content

feat(grep): add --include/--exclude glob patterns#229

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 23, 2026
Merged

feat(grep): add --include/--exclude glob patterns#229
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 23, 2026

Summary

  • Add --include=GLOB and --exclude=GLOB options for grep -r recursive search
  • Fix recursive grep to always show filenames (matching real grep behavior)
  • Fix multi-file filename display to use actual input count instead of CLI arg count
  • Add strip_quotes helper for = option values
  • Add glob_matches and should_include_file helper functions

Test plan

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features — all tests pass
  • 17 grep unit tests pass (including 2 new recursive include/exclude)
  • grep spec tests pass — 2 previously-skipped tests now active, 1 new test added

Implement --include=GLOB and --exclude=GLOB options for grep -r recursive
search. Filenames are matched against glob patterns to filter which files
are searched. Also fix recursive grep to always show filenames (matching
real grep behavior) and use input count instead of CLI arg count for
multi-file filename display.

Remove 2 skip markers, add 1 new spec test, 4 new unit tests.

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
@chaliy chaliy merged commit 5a881fc into main Feb 23, 2026
16 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.

2 participants