| Crates.io | my_mini_grep |
| lib.rs | my_mini_grep |
| version | 0.1.0 |
| created_at | 2024-07-29 17:34:45.569197+00 |
| updated_at | 2024-07-29 17:34:45.569197+00 |
| description | A mini application that aims to replicate the behavior of the grep shell command. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1319053 |
| size | 5,684 |
This project aims to replicate the behavior of the grep shell command. It searches for a specific string within a file and returns all lines that contain that string.
• Case-sensitive search by default.
• Case-insensitive search available through an environment variable.
The program requires two command line arguments:
1. Search String: The string to search for within the file.
2. File Path: The path to the file where the search will be performed.
cargo run -- "search_string" file.txt
To perform a case-insensitive search, set the IGNORE_CASE environment variable to 1. This will make the search case insensitive for the lifetime of that terminal session.
IGNORE_CASE=1 cargo run -- "search_string" file.txt