Crates.io | quewuigrep |
lib.rs | quewuigrep |
version | 0.1.1 |
source | src |
created_at | 2024-07-28 01:37:21.498745 |
updated_at | 2024-07-28 02:07:20.28846 |
description | A simple grep-like tool written in Rust. |
homepage | |
repository | |
max_upload_size | |
id | 1317650 |
size | 9,435 |
Quewuigrep is a command-line utility for searching a word or phrase in a file. It mimics the functionality of the classic grep
command but is implemented in Rust. This tool allows you to perform both case-sensitive and case-insensitive searches.
To install Quewuigrep, you need to have Rust installed on your machine. If you don't have Rust installed, you can get it from rust-lang.org.
Clone the repository and build the project:
sh git clone https://github.com/yourusername/quewuigrep.git cd quewuigrep cargo build --release
The executable will be located in the target/release
directory.
To use Quewuigrep, run the following command:
sh ./quewuigrep <query> <filename>
<query>
: The word or phrase you want to search for.<filename>
: The file in which to search.sh ./quewuigrep "search_term" example.txt
To perform a case-insensitive search, set the CASE_INSENSITIVE
environment variable:
sh CASE_INSENSITIVE=1 ./quewuigrep "search_term" example.txt
run
function.Config
struct, run
function, and search functions.To run the tests, use the following command:
sh cargo test
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.