A basic command-line grep clone written in Rust. This is a learning project I built while working through The Rust Programming Language. It follows the minigrep tutorial with a some personal modifications.
- Added case-insensitive search flag.
- Refactored
searchandsearch_case_insensitiveto return anIteratorinstead of aVec.
cargo run -- query_string file_pathCase-insensitive search can be enabled in two ways:
Option 1: Command-line argument
cargo run -- query_string file_path 1Use 1 for case-insensitive and 0 for case-sensitive.
Option 2: Environment variable
IGNORE_CASE=1 cargo run -- query_string file_pathIf both are provided, the command-line argument takes precedence over the environment variable.