Skip to content

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 21, 2026

This PR adds support for filtering search results by file extension, glob patterns (include/exclude), and file type categories.

Changes

  • Added --ext to filter by file extension (e.g. --ext rs,toml)
  • Added --glob to include files matching glob patterns (e.g. --glob "src/**/*.rs")
  • Added --exclude to exclude files matching glob patterns (e.g. --exclude "target/**")
  • Added --type to filter by predefined file categories (code, config, docs)
  • Implemented FileFilter in src/core/filter.rs
  • Updated SearchEngine and Database to apply filters
  • Added unit tests for filtering logic

Example Usage

vgrep "query" --ext rs
vgrep "query" --glob "src/**/*.rs" --exclude "**/*test*"
vgrep "query" --type code

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.

3 participants