Grepster
A simple command-line utility for searching text in files, inspired by the classic Unix grep tool.
Features
- Search for text patterns in files
- Support for case-sensitive and case-insensitive searches
- Search multiple files at once
- Regular expression pattern matching
- Display line numbers in search results
- Simple and intuitive command-line interface
Installation
From crates.io
From source
Usage
Basic search (case-sensitive)
Search multiple files
Case-insensitive search
IGNORE_CASE=1
Regular expression search
USE_REGEX=1
Display line numbers
SHOW_LINE_NUMBERS=1
Combine options
IGNORE_CASE=1 USE_REGEX=1 SHOW_LINE_NUMBERS=1
Examples
Search for "Rust" in a file named "programming.txt":
Search for "rust" in multiple files, ignoring case:
IGNORE_CASE=1
Search for lines starting with a function definition in Rust files:
USE_REGEX=1
Search for error lines in log files and show line numbers:
SHOW_LINE_NUMBERS=1
Using as a Library
You can also use grepster as a library in your Rust projects:
use env;
use ;
License
See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.