From cfc7b1266ab880946ed93f5290d7d9e65fe38380 Mon Sep 17 00:00:00 2001 From: Fabio Montefuscolo Date: Wed, 2 Apr 2025 07:39:29 +0200 Subject: [PATCH] generated README.md --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..31ddc78 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# grrs - A Rust CLI Search Tool + +This is a learning project based on the [Command Line Applications in Rust](https://rust-cli.github.io/book/tutorial/) tutorial. The project implements a simple grep-like command-line tool that searches for a pattern in a file. + +## Project Overview + +`grrs` (pronounced "grass") is a simple CLI tool that: +- Takes a pattern and a file path as command-line arguments +- Searches for the pattern in the specified file +- Prints each line that contains the pattern + +This project demonstrates: +- Command-line argument parsing with `clap` +- File I/O operations in Rust +- Error handling with the `Result` type +- Structuring a Rust CLI application + +## Building and Running + +### Using Cargo + +```bash +# Build the project +cargo build + +# Run the project (replace PATTERN and PATH with your values) +cargo run -- PATTERN PATH +``` + +### Using podman or docker + +```bash +# Build the project +podman run -v$PWD:/app:z -w/app --rm rust cargo build + +# Run the project (replace PATTERN and PATH with your values) +podman run -v$PWD:/app:z -w/app --rm rust cargo run -- PATTERN PATH +```