Code Monkey home page Code Monkey logo

grep's Introduction

Creating a comprehensive README for your GitHub repository is crucial for helping users understand your code, its purpose, and how to use it effectively. Below, I've provided a template for your README based on your code and the options you've implemented. Remember to replace placeholders with actual content:

Text Search Tool

This is a versatile text search tool developed in Rust that allows you to search for specific patterns in files and directories. It offers various search options, including case-insensitive searching, non-matching results, and the ability to search within directories.

Table of Contents

Features

  • Search for patterns in files and directories.
  • Option for case-insensitive searching.
  • Find files that do not match the specified pattern.
  • Search within directories and their contents.
  • Define search depth within directories.
  • Parallel searching using multiple threads.
  • Utilizes the regex and walkdir crates.
  • Easy-to-use command-line interface.

Prerequisites

Before using this tool, ensure you have the following prerequisites:

Usage

Clone the repository and build the tool using the following commands:

git clone https://github.com/yourusername/text-search-tool.git
cd text-search-tool
cargo build --release

Run the tool with the desired options:

cargo run [OPTIONS] PATTERN [FILE/DIRECTORY]

Configuration Options

The tool supports various options that customize your search. These options are specified as environment variables:

  • IC: Perform case-insensitive searching.
  • NON: Find files and lines that do not match the pattern.
  • DIR: Search inside directories and find only files with the pattern.
  • IN: Search inside files found in directories.
  • DPT:[1..n]: Specify the search depth through directories (default is 1).
  • TH: Enable parallel searching.
  • NT:[1..n]: Specify the number of threads for parallel searching (default is 6).

Examples

Basic Usage

Search for the pattern "example" in a file:

cargo run example path/to/yourfile.txt

Case-Insensitive Search

Perform a case-insensitive search for "example" in a file:

IC=1 cargo run example path/to/yourfile.txt

Non-Matching Results

Find lines in a file that do not contain "example":

NON=1 cargo run example path/to/yourfile.txt

Search in Directories

Search for files containing "example" within a directory:

DIR=1 cargo run example path/to/yourdirectory

Search Inside Files in Directories

Search inside files found in directories:

IN=1 cargo run example path/to/yourdirectory

Parallel Searching

Enable parallel searching with a specified number of threads:

TH=1 NT:4 cargo run example path/to/yourdirectory

grep's People

Contributors

amiralv82 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.