/minigrep

A simple grep-like program written in Rust.

Primary LanguageRust

minigrep

A simple grep-like program written in Rust.

Usage

minigrep <pattern> <file>

if you want to ignore case:

IGNORE_CASE=1 minigrep <pattern> <file>

Example

➜ cargo run -- to ./poem.txt
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `target/debug/minigrep to ./poem.txt`
Are you nobody, too?
How dreary to be somebody!

➜ IGNORE_CASE=1 cargo run -- to ./poem.txt
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `target/debug/minigrep to ./poem.txt`
Are you nobody, too?
How dreary to be somebody!
To tell your name the livelong day
To an admiring bog!