A simple command-line tool written in Rust for searching for a query string in a file. Inspired by the classic grep utility, minigrep is a lightweight alternative for basic search needs.
- Search for a string in a text file
- Case-sensitive and case-insensitive search modes
- Simple and easy-to-understand codebase
cargo run -- <QUERY> <FILENAME><QUERY>: The string to search for.<FILENAME>: The path to the file to search in.
Example:
cargo run -- to poem.txtTo run in case-insensitive mode, set the CASE_INSENSITIVE environment variable:
CASE_INSENSITIVE=1 cargo run -- to poem.txtTo build the project, ensure you have Rust installed, then run:
cargo buildYou can run the tests using:
cargo test