#grep #txt #poem #tiny #ignore-case #command-line-tool #search

bin+lib minigrepf

A tiny grep clone to search a single file, with an IGNORE_CASE environment variable option

3 releases

0.1.3 Jan 5, 2023
0.1.1 Jan 4, 2023
0.1.0 Jan 4, 2023

#4 in #ignore-case

Download history 21/week @ 2024-02-26 53/week @ 2024-04-01

53 downloads per month

MIT license

6KB
92 lines

minigrepf

This is the simple minigrepf command line tool from the book "The Rust Programming Language," chapter 12.

Usage:

$ ls
poem.txt minigrepf

$ 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!

$ ./minigrepf to poem.txt
Are you nobody, too?
How dreary to be somebody!

$ IGNORE_CASE=1 ./minigrepf to poem.txt
Are you nobody, too?
How dreary to be somebody!
To tell your name the livelong day
To an admiring bog!

lib.rs:

minigrepf

minigrepf is a tiny command line tool built as an exercise from the book "The Rust Programming Language," chapter 12.

Usage

$ ls
poem.txt minigrepf

$ 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!

$ ./minigrepf to poem.txt
Are you nobody, too?
How dreary to be somebody!

$ IGNORE_CASE=1 ./minigrepf to poem.txt
Are you nobody, too?
How dreary to be somebody!
To tell your name the livelong day
To an admiring bog!

No runtime deps