Expand description
§XGrep - A High-Performance Rust Grep Implementation
XGrep is a fast, parallel grep implementation written in Rust that searches for patterns in files and directories with syntax highlighting and detailed search statistics.
§Features
- Parallel Processing: Multi-core file processing with intelligent thread pool management
- Pattern Matching: Regular expression engine with optimized performance
- Structured Streaming: Organized results with comprehensive statistics and timing
- Directory Traversal: Recursive scanning with symlink support
- Colorized Output: Customizable syntax highlighting (red, green, blue, bold)
- Search Statistics: Structured result format with timing metrics using
--stats
§Usage
use xerg::{run, colors::Color};
use std::path::PathBuf;
let dir = PathBuf::from(".");
let pattern = "use";
let color = Color::Blue;
let show_stats = true;
run(&dir, pattern, &color, show_stats);§Architecture
The library is organized into several focused modules:
colors: ANSI color management and formattingcrawler: Directory traversal with symlink supporthighlighter: Regex-based text highlightingresult: Message handling and statistics result formattingsearch: Formatted parallel file processing (use –formatted flag)search_xtreme: Ultra-fast raw output mode for maximum speed (default)
Modules§
- colors
- Color Management
- crawler
- Directory Traversal
- highlighter
- Text Highlighting
- result
- Search Results Management
- search
- Parallel File Search
- search_
xtreme - Xtreme Search Mode