Skip to content

1ort/grep-light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grep-light

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).

Features

  • 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.

Usage

grep-light <pattern> [input]

Flags

  • -h, --help: Prints help information.
  • -V, --version: Prints version information.

Arguments

  • <pattern>: The pattern to search for.
  • <input>: The file to search in. If not provided, grep-light will read from standard input.

Example

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

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/grep-light.git
  2. Navigate to the project directory:

    cd grep-light
  3. Build and run the project using Cargo:

    cargo run -- <pattern> [input]

Educational Purpose

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.

Note

This README.md was generated by an AI assistant.


Enjoy using grep-light for your text search needs! 🔍

About

Works almost like normal grep :D

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages