Crates.io | minigrep-extremq |
lib.rs | minigrep-extremq |
version | 0.1.0 |
source | src |
created_at | 2024-09-15 18:09:47.258928 |
updated_at | 2024-09-15 18:09:47.258928 |
description | Example crate from the rustbook. |
homepage | |
repository | |
max_upload_size | |
id | 1375621 |
size | 4,688 |
This is a very useful program that lets you search for lines that contain a specific string within a file.
I do not know how to compile to an executable right now, so that's an issue.
Search for lines containing "frog":
cargo run -- frog poem.txt
# Outputs "How public, like a frog"
Search for lines containing "you know":
cargo run -- "you know" poem.txt
# Outputs "They'd banish us, you know."
Search for lines containing "to", but case insensitive:
IGNORE_CASE=1 cargo run -- "to" poem.txt
# Outputs
Are you nobody, too?
How dreary to be somebody!
To tell your name the livelong day
To an admiring bog!