SimpleGrep ๐ต๏ธโโ๏ธ๐
A simple command-line text search tool in Rust, inspired by grep.
Supports both case-sensitive and case-insensitive search.
๐ Getting Started
Clone the repository and run with cargo:
Example
This will search for the word Rust in input.txt with case-sensitive matching and writes the result to output.txt file if there is no any error. Otherwise, it prints out the error message in standard error console
๐ Case Insensitive Search
To perform a case-insensitive search, set the environment variable IGNORE_CASE to 1:
IGNORE_CASE=1
๐งช Running Tests
The app comes with a built-in test suite. Run all tests using:
๐ Project Structure
main.rs: Entry point that parses CLI arguments and calls the search logic.lib.rs: Contains theConfigstruct and therun,search, andsearch_case_insensitivefunctions.tests/lib_test.rs: Unit tests for both case-sensitive and case-insensitive search.