looneygrep 0.1.0

A powerful command-line search tool with web page support and replace functionality.
Documentation
  • Coverage
  • 100%
    12 out of 12 items documented4 out of 5 items with examples
  • Size
  • Source code size: 74.31 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 748.41 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 48s Average build duration of successful builds.
  • all releases: 48s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • LooneyRichie/looneygrep
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • LooneyRichie

Looneygrep

Looneygrep is executable as lg for those who wish to type less

Looneygrep is a feature-rich, blazing-fast command-line text search tool created by Richie Looney as a modern alternative to grep and ripgrep.
It supports searching files, web pages, and even interactive replacement of matches.


Features

  • 🔍 Search files or web pages for a query string
  • 🅰️ Optional case-insensitive search
  • 📝 Prompt-to-replace matches interactively
  • 📄 Show context lines around matches
  • 🎨 Syntax highlighting for code files
  • 🧠 File type awareness
  • 📂 Search all files in a directory with --all

Installation

From crates.io:

cargo install looneygrep

Or clone and build manually:

git clone https://github.com/looneyrichie/looneygrep.git
cd looneygrep
cargo build --release

Usage

looneygrep <query> <filename> [--ignore-case] [--replace] [--context N] [--url <url>] [--all]

Examples

Search a file:

looneygrep foo myfile.txt

Search a web page:

looneygrep Rust --url https://www.rust-lang.org

Case-insensitive search with context:

looneygrep error log.txt --ignore-case --context 2

Prompt to replace matches:

looneygrep oldword file.txt --replace

Search all files in the current directory:

looneygrep TODO --all

Library Usage

You can also use Looneygrep as a library in your Rust code:

use looneygrep::{Config, run};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = Config {
        query: "foo".to_string(),
        file_path: "bar.txt".to_string(),
        ignore_case: false,
        replace: false,
        url: None,
        context: 0,
        search_all: false,
    };
    run(config)?;
    Ok(())
}

License

Licensed under either of


Author

Richie Looney (richieandkayla@gmail.com)


Contributions welcome!