Project from Rust Book which makes a light weight version of the grep
CLI tool
- In this project dir & with
rustc
installed on your machine (see #Build section)
# Case Sensitive (ignores letter case)
cargo run -- word file.extension
# Case Insensitve
## 1. In sh & zsh
IGNORE_CASE=1 cargo run -- word file.extension
## 2. In Windows Powershell
$Env:IGNORE_CASE=1; cargo run -- word file.extension
eg. cargo run -- to poem.txt
- With the built binary (eg. minigrep.exe)
# Case Sensitive (ignore letter case)
## In Window Powershell, sh & zsh
./mingrep word file.extension
# Case Insenstive
## 1. sh & zsh
IGNORE_CASE=1 ./minigrep word file.extension
## 2. Windows Powershell
$Env:IGNORE_CASE=1; ./minigrep word file.extension
## 3. Remove IGNORE_CASE environment variable in Windows Powershell
Remove-Item Env:IGNORE_CASE
-
Install Rust by following the official docs
-
Run
cargo build
for Debug build orcargo build --release
Release build -
You'll find your binaries in
target/debug
&target/release
for Debug & Release respectively
-
Head over to the CI/CD Pipeline Action
-
Click on one of the latest successful runs
-
Scroll to the bottom to the
Atifacts
section and download the relevant binary
Run:
cargo test
## With standard output data
cargo test -- --show-output