Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 6.52 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 234.07 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • morehwachege/vira
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • morehwachege

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

git clone https://github.com/yourusername/vira.git
cd vira
cargo build --release
sudo cp target/release/vira /usr/local/bin/

Using Cargo

cargo install vira

Usage - basic syntax

vira <pattern> [filename]

Examples Search in a file:

vira "hello" example.txt

Output: Lines containing hello will be shown with the match highlighted in red.

Search in standard input:

cat example.txt | vira hello

Case-insensitive search:

 vira "Hello" example.txt  # Matches "hello", "HELLO", "Hello", etc.

Output Example

When you run:

vira "rust" README.md

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

  1. Vira reads the pattern from the first command-line argument

  2. If a filename is provided, it searches the file line by line

  3. If no filename is given, it reads from standard input

  4. For each line containing the pattern, it prints the line with matches highlighted in red

  5. 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!