| Crates.io | minigrep-tool-cli |
| lib.rs | minigrep-tool-cli |
| version | 0.1.1 |
| created_at | 2025-08-16 17:42:55.341226+00 |
| updated_at | 2025-08-16 17:55:53.394133+00 |
| description | A simple command-line search tool |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1798696 |
| size | 9,319 |
A simple implementation of the grep command-line tool, written in Rust.
minigrep <query> <file_path>
<query>: The string to search for.<file_path>: The path to the file to search in.To search for the word "nobody" in a file named poem.txt:
$ cat poem.txt
I'm nobody! Who are you?
Are you nobody, too?
Then there's a pair of us - don't tell!
They'd banish us, you know.
How dreary to be somebody!
How public, like a frog
To tell your name the livelong day
To an admiring bog!
$ minigrep nobody poem.txt
Found I'm nobody! Who are you?
Found Are you nobody, too?
To perform a case-insensitive search, set the CASE_MODE environment variable to insensitive.
$ export CASE_MODE=insensitive
$ minigrep rUsT poem.txt
Found Rust:
To build the project from source, you will need to have Rust and Cargo installed. You can find instructions on how to install them here.
Once you have Rust and Cargo installed, you can build the project by running the following command in the project's root directory:
cargo build --release
The compiled binary will be located at target/release/minigrep.