Vira
A lightweight, colorful text search tool inspired by grep. Vira searches for patterns in text and highlights matches with beautiful colored output.
Features
-
🔍 Pattern Matching - Search for text patterns in files or standard input
-
🎨 Colored Highlights - Matches are displayed in red for easy visibility
-
📁 File Support - Search through text files with ease
-
🔄 Pipeline Friendly - Works seamlessly with Unix pipes and redirections
-
🚀 Fast & Simple - Lightweight and minimal dependencies
Installation
From Source
Using Cargo
Usage - basic syntax
Examples Search in a file:
Output: Lines containing hello will be shown with the match highlighted in red.
Search in standard input:
|
Case-insensitive search:
Output Example
When you run:
You might see:
This project is written in rust and is very fast.
The rust ecosystem provides excellent tooling.
With "rust" highlighted in red for better visibility.
Technical Details
How It Works
-
Vira reads the pattern from the first command-line argument
-
If a filename is provided, it searches the file line by line
-
If no filename is given, it reads from standard input
-
For each line containing the pattern, it prints the line with matches highlighted in red
-
The search is case-insensitive, but the original text formatting is preserved
Limitations
Currently supports single pattern matching only
No regex support (planned for future releases)
No line numbering or context display (coming soon)
Future Plans
-
Regular expression support
-
Line numbering
-
Context lines (show surrounding lines)
-
Multiple pattern support (AND/OR logic)
-
Recursive directory search
-
Configuration file support
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - feel free to use this project however you like.
Happy searching!