Skip to content

minigrep is a command line tool that interacts with file and cli input/output.

Notifications You must be signed in to change notification settings

bruce-mig/mini-grep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mini-grep

minigrep is a a command line tool that interacts with file and command line input/output.
It recursively searches the current directory for a regex pattern.
It is similar to other popular search tools like grep.

Usage

Command line arguments are passed after the --.

$ cargo run -- <query> <filepath> > <output-file>
  • The first argument <query> holds the string to search for.
  • The second argument <filepath> is the path of the .txt file to conduct the search.

Example Usage

$ cargo run -- to poem.txt > output.txt

Environment variables

Toggle between case sensitive and case insensitive search by passing the IGNORE_CASE environment variable.

$ IGNORE_CASE=1 cargo run -- <query> <filepath> > <output-file>

Set environment variables are valid for the duration of the current terminal session.

About

minigrep is a command line tool that interacts with file and cli input/output.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages