Skip to content

TrezorTop/rust-minigrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8975814 · Apr 8, 2024

History

13 Commits
Apr 8, 2024
Apr 2, 2024
Apr 2, 2024
Apr 2, 2024
Apr 7, 2024
Apr 2, 2024

Repository files navigation

Minigrep

Minigrep is a simple command-line application written in Rust. It allows you to search for a specific query within a text file. The application supports both case-sensitive and case-insensitive searches.

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

  • Rust programming language installed on your machine. You can download it from here.

Installation

  1. Clone the repository
git clone https://github.com/TrezorTop/rust-minigrep.git
  1. Navigate to the project directory
cd rust-minigrep
  1. Build the project
cargo build

Usage

You can run the application using the cargo run command followed by your search query and the path to the file you want to search in.

cargo run <query> <file_path>

For example, to search for the word "frog" in a file named "sample.txt", you would run:

cargo run frog sample.txt

By default, the search is case-sensitive. If you want to perform a case-insensitive search, you can set the IGNORE_CASE environment variable.

IGNORE_CASE=1 cargo run frog sample.txt

Running Tests

You can run the tests using the cargo test command.

cargo test

About

Simple GREP implementation for education purposes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages