Crate grepmini

Source
Expand description

A simple command-line tool to search for a string in a file. It takes a search string, a file path, and an optional flag to ignore case.

§Example

minigrep test some_text.txt -i

Structs§

Config

Functions§

run
Reads the contents of the file specified in the config, searches for the query in the contents, and prints the lines that contain the query.
search
Searches for the query in the contents of the file. Returns a vector of tuples, where each tuple contains the line number and the line itself that contains the query. The line numbers are 0-indexed.