| Crates.io | grepfinder |
| lib.rs | grepfinder |
| version | 0.1.0 |
| created_at | 2025-10-29 07:32:03.988647+00 |
| updated_at | 2025-10-29 07:32:03.988647+00 |
| description | A tool to search files |
| homepage | https://github.com/siddharth-09/grep-cli-clone |
| repository | https://github.com/siddharth-09/grep-cli-clone |
| max_upload_size | |
| id | 1906161 |
| size | 15,072 |
A simple command-line utility written in Rust that searches for a pattern in a file and displays all matching lines.
Clone the repository and build the project:
git clone https://github.com/siddharth-09/grep-cli-clone
cd grep-cli-clone
cargo build --release
The compiled binary will be available at target/release/pattern-search.
Run the tool with a pattern and file path:
cargo run -- <PATTERN> <FILE_PATH>
Search for "error" in a log file:
cargo run -- "error" logs/app.log
Search for a function name in source code:
cargo run -- "fn main" src/main.rs
Using the compiled binary directly:
./target/release/pattern-search "TODO" notes.txt
anyhow - Error handling with contextclap - Command-line argument parsingThe tool provides helpful error messages if the file cannot be read:
could not read file `nonexistent.txt`
MIT