graby

Crates.iograby
lib.rsgraby
version1.0.0
sourcesrc
created_at2023-08-01 12:00:45.121751
updated_at2023-09-08 11:33:08.720178
descriptionSearch and print matching patterns in given file.
homepagehttps://github.com/Raghav-Bell/graby
repositoryhttps://github.com/Raghav-Bell/graby
max_upload_size
id931824
size27,612
Raghav (Raghav-Bell)

documentation

https://docs.rs/graby/0.1.0/graby/

README

build version version_downloades License

Introduction

This is a small implementation of grep command line tool in rust (see References). From version 1.0.0 onwards regular expressions or regex is also supported. For complete implementation of grep in rust, check ripgrep.

Installation

For running or installing graby, install rust. To add graby run the following cargo command in your project directory:

cargo add graby

or manually add following in Cargo.toml file.

graby = "1.0.0" # graby = "version"

To build graby from source you need to install rust on your device and run the following commands:

git clone https://github.com/Raghav-Bell/graby.git
cd graby
cargo run -- --help

or you can also build it from released binaries.

Usage

For searching QUERY pattern in FILE_PATH use following command:

graby --q QUERY --f FILE_PATH

For more options run

graby --help

Usage: graby.exe [OPTIONS] --query <QUERY> --file-path <FILE_PATH>

Options:
  -q, --query <QUERY>          Pattern to search in the file
  -r, --regex-match            Take pattern as regular expression
  -f, --file-path <FILE_PATH>  Path to the file
  -i, --ignore-case            Ignore case distinctions while searching QUERY in FILE_PATH
  -v, --invert-match           Print the lines without QUERY pattern in the FILE_PATH
  -h, --help                   Print help
  -V, --version                Print version

or check documentation.
It is licensed under MIT.

How to Contribute

All small or large contributions are welcomed .

References

ch-12 rust-lang book, Command Line Applications in Rust

Commit count: 34

cargo fmt