minigrep-tool-cli

Crates.iominigrep-tool-cli
lib.rsminigrep-tool-cli
version0.1.1
created_at2025-08-16 17:42:55.341226+00
updated_at2025-08-16 17:55:53.394133+00
descriptionA simple command-line search tool
homepage
repository
max_upload_size
id1798696
size9,319
Pietro Di Bello (xpepper)

documentation

README

minigrep

A simple implementation of the grep command-line tool, written in Rust.

Usage

minigrep <query> <file_path>
  • <query>: The string to search for.
  • <file_path>: The path to the file to search in.

Examples

Basic Search

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?

Case-Insensitive Search

To perform a case-insensitive search, set the CASE_MODE environment variable to insensitive.

$ export CASE_MODE=insensitive
$ minigrep rUsT poem.txt
Found Rust:

Building

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.

Commit count: 0

cargo fmt