Skip to content

molulan/minigrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minigrep

A basic command-line grep clone written in Rust. This is a learning project I built while working through The Rust Programming Language. It follows the minigrep tutorial with a some personal modifications.

Personal modifications

  • Added case-insensitive search flag.
  • Refactored search and search_case_insensitive to return an Iterator instead of a Vec.

Usage

cargo run -- query_string file_path

Case-insensitive search

Case-insensitive search can be enabled in two ways:

Option 1: Command-line argument

cargo run -- query_string file_path 1

Use 1 for case-insensitive and 0 for case-sensitive.

Option 2: Environment variable

IGNORE_CASE=1 cargo run -- query_string file_path

If both are provided, the command-line argument takes precedence over the environment variable.

About

Basic command-line grep clone. A learning project from the rust book with some personal adjustments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages