https://github.com/robotomize/tiny-grep
Tiny grep, highlight patterns, read from stdin only
https://github.com/robotomize/tiny-grep
grep highlight text
Last synced: about 2 months ago
JSON representation
Tiny grep, highlight patterns, read from stdin only
- Host: GitHub
- URL: https://github.com/robotomize/tiny-grep
- Owner: robotomize
- License: mit
- Created: 2024-02-11T03:52:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-19T21:56:24.000Z (over 1 year ago)
- Last Synced: 2025-02-08T14:16:00.665Z (4 months ago)
- Topics: grep, highlight, text
- Language: Rust
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tiny grep
The tiny-grep is a simple, yet powerful command-line utility written in Rust that filters and highlights specified
patterns
in text input from stdin.## Why
This is a tutorial project that can only read standard input.## Features
* Pattern Matching: Search for and highlight specified patterns within the text input from stdin.
* Color Highlighting: Uses the colored library to highlight matching patterns in red for easy identification.
* Multiple Pattern Support: Allows specifying multiple patterns as arguments for simultaneous search and highlight.
* Line Numbering: Outputs the line number alongside the original text, aiding in locating the highlighted patterns
within the context.## Requirements
To use this utility, you need to have Rust installed on your system. This project also depends on the colored crate for text coloring functionality.## Install
```shell
git clone https://github.com/robotomize/tiny-grep.git
cd tinygrep
```## Usage
To use the grp, simply pass the patterns you want to highlight as arguments when running the program. You can specify
multiple patterns separated by spaces:
```shell
cargo run -- pattern1 pattern2 pattern3
cargo build
cat main.rs|./tiny-grep stdin
```## License
This project is licensed under the MIT License - see the LICENSE.md file for details.