Skip to content

mellowcroc/minigrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minigrep

This is a command line program that implements the minigrep project from the Rust book.

Functionality:

  • Parse text files into lines
  • Find and print lines that contain the query argument from command line
  • Supports case-insensitive search via environment variable

Running this program

You can run unit tests on this via:

cargo test

You can run the program via the following syntax:

cargo run [query text] [text file]

For example,

cargo run frog poem.txt

Note that poem.txt is included in this project.

Case-insensitive Search

If you're using PowerShell, you can use the environment variable via the following:

PS> $Env:CASE_INSENSITIVE=1; cargo run [query text] [text file]

Since the variable will persist for the remainder of the shell session, you can unset it via the following:

PS> Remove-Item Env:CASE_INSENSITIVE

TESTING AGAIN

About

minimal version of grep using rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages