Crates.io | rgon |
lib.rs | rgon |
version | 1.0.1 |
source | src |
created_at | 2024-11-12 15:54:00.399827 |
updated_at | 2024-11-16 09:52:15.559409 |
description | A command-line tool written in Rust that searches for a query string within a file. |
homepage | |
repository | |
max_upload_size | |
id | 1445096 |
size | 205,580 |
rgon
is a command-line tool written in Rust that searches for a query string within a file.
IGNORE_CASE
environment variable is set.To use rgon
, you'll need to have Rust and Cargo installed. If you don't have them, you can install them from https://rust-lang.org.
To install and run rgon
, clone the repository and build the project:
git clone https://github.com/jmeq17/rgon.git
cd rgon
cargo build --release
Once installed, you can use rgon
by running the following command:
cargo run -- [OPTIONS] <query> <file_path>
cargo run -- "to" "assets/tinyTale.txt"
This will search for the string "to"
in the file assets/tinyTale.txt
and print all matching lines.
To perform a case-insensitive search, set the IGNORE_CASE
environment variable:
cargo run -- -i "To" "assets/tinyTale.txt"
This will match both "To"
and "to"
in the file.
-i
or --ignore-case
:ignore case sensitivity.To run the tests:
cargo test
This will run the unit tests for search
and search_case_insensitive
functions.
This project is licensed under the MIT License - see the LICENSE file for details.