16 releases

0.2.19 Nov 6, 2022
0.2.18 Nov 6, 2022
0.2.17 Oct 16, 2022
0.2.14 Aug 13, 2022
0.2.5 Mar 31, 2022

#915 in Text processing

Unlicense

21KB
565 lines

grepox

Crates.io

Minimalist's grep written in Rust, inspired by ripgrep.

Disclaimer

This project was made as a learning project.

That being said, I do try my best to make the code as good as I know about and may occasionally revisit with optimizations.

However, it is unlikely that large feature updates are made.

Usage

Usage: grepox [OPTION]... QUERY [FILES]...
Search for QUERY in FILES.
Example:
    # Finds the phrase 'hello world' case-insensitively in file1.txt
    # and file2.txt and prints matches in color
    grepox -ci 'hello world' file1.txt file2.txt

Options:
-i          Ignore case distinctions in QUERY
-n          Print line number with output lines
-v          Invert match: select non-matching lines
-F          String searching, disables regex
-x          Only match whole lines, only works with -F
-w          Only match whole words, only works with -F
-m=<NUM>    Stop after NUM matches
-c          Colorizes output
-h          Print this help and exit

Features

  • Regex support
  • Reads from stdin so users can pipe programs' outputs into it (e.g. seq 10000 | grepox '^\d{1,3}$')
  • Customizable using command flags
  • Colors

Dependencies

~4–5.5MB
~101K SLoC