grep-light
is a minimalistic command-line tool written in Rust, inspired by the classic grep
utility. It allows you to search for patterns in files or standard input, making it a simple yet effective tool for text search tasks. This project was created as an exercise from the book "Rust in Action" by Tim McNamara (timClicks).
- Pattern Search: Search for a specified pattern in a file or standard input.
- Minimalistic: A lightweight and straightforward implementation of the
grep
functionality. - Easy to Use: Simple command-line interface with intuitive options.
grep-light <pattern> [input]
-h, --help
: Prints help information.-V, --version
: Prints version information.
<pattern>
: The pattern to search for.<input>
: The file to search in. If not provided,grep-light
will read from standard input.
To search for the pattern "hello" in a file named example.txt
:
grep-light hello example.txt
To search for the pattern "world" in the standard input:
echo "hello world" | grep-light world
-
Clone the repository:
git clone https://github.com/yourusername/grep-light.git
-
Navigate to the project directory:
cd grep-light
-
Build and run the project using Cargo:
cargo run -- <pattern> [input]
This project was created as an exercise from the book "Rust in Action" by Tim McNamara (timClicks). It serves as a practical example of how to implement a simple text search tool in Rust.
This README.md was generated by an AI assistant.
Enjoy using grep-light
for your text search needs! 🔍