#file-path #query #line #run #command-line #filename #txt

bin+lib minigrep_necimye

Functions required to find the lines in file that contains the query. query and file path should be entered through command line preceded by two dashes. Ex: cargo run -- body filename.txt

2 releases

0.1.1 Dec 25, 2022
0.1.0 Oct 9, 2022

#27 in #txt

MIT license

300KB
102 lines

It is the rust application for searching lines in a file using words like a grep tool in linux

Instruction

Installation

  • Install rust using rustc, and latest visual studio build tools
  • Fork and clone this repo and run cargo install in the command line

Building and Running

  • First write some unit tests, there are already two test written
  • For checking tests run cargo test
  • Build application using cargo build
  • Run application using cargo run text filename.txt
  • if you want to search words by applying environment variable IGNORE_CASE then run using IGNORE_CASE=1 cargo run text filename.txt
  • If you want to remove that environment variable run PS> Remove-Item Env:IGNORE_CASE in the terminal the environment variable will be removed

If you are interesting using this application as a dependency to your big project, use the crate minigrep_necimye and you can use the functions written inside lib.rs

If you are interested to contribute this project, fork and make the new pull requests after cloning this project. You are not allowed to work in the base branch

Some Samples

Dependencies

~1.5MB
~24K SLoC