Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asnunes/minigrep
It searches contents in a file
https://github.com/asnunes/minigrep
Last synced: 26 days ago
JSON representation
It searches contents in a file
- Host: GitHub
- URL: https://github.com/asnunes/minigrep
- Owner: asnunes
- Created: 2021-05-16T17:28:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-22T14:38:41.000Z (over 3 years ago)
- Last Synced: 2024-10-26T15:46:56.981Z (2 months ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minigrep
Minigrep is a Rust CLI application to match strings in a given text file. It's one of the projects of "The Rust Programming Language" book by Steve Klabnik and Carol Nichols.
The application expects two arguments: the string to look for and the file where it should search:
```
# my_file.txt
I should write a line here, but what should I say?
I should also write another one because it is two results, but.... This line will match?
And this?
``````bash
$ minigrep but my_file.txtI should write a line here, but what should I say?
I should also write another one because it is two results, but.... This line will match?
```It also accepts case insensitive searches. Just set CASE_INSENSITIVE env variable:
```bash
$ CASE_INSENSITIVE=1 minigrep "and this" my_file.txtAnd this?
```# building
Make sure you have Rust installed (available at https://www.rust-lang.org/). To compile just clone this repository and run the following command:
```bash
cargo build --release
```