hgrep is a grep tool to search files with given pattern and print the matched code snippets with human-friendly syntax highlighting. In short, it's a fusion of bat and grep or other alternatives like ripgrep. This is similar to -C option of grep command, but hgrep focuses on human readable outputs. hgrep is useful to survey the matches with contexts around them. When some matches are near enough, hgrep prints the lines within one code snippet. Unlike grep -C, hgrep adopts some heuristics around blank lines to determine efficient number of context lines.
hgrep is a grep tool to search files with given pattern and print the matched code snippets with human-friendly syntax highlighting. In short, it's a fusion of bat and grep or other alternatives like ripgrep. This is similar to -C option of grep command, but hgrep focuses on human readable outputs. hgrep is useful to survey the matches with contexts around them. When some matches are near enough, hgrep prints the lines within one code snippet. Unlike grep -C, hgrep adopts some heuristics around blank lines to determine efficient number of context lines.
To install hgrep, run the following command in macOS terminal (Applications->Utilities->Terminal)
sudo port install hgrep
To see what files were installed by hgrep, run:
port contents hgrep
To later upgrade hgrep, run:
sudo port selfupdate && sudo port upgrade hgrep
Reporting an issue on MacPorts Trac
The MacPorts Project uses a system called Trac to file tickets to report bugs and enhancement requests.
Though anyone may search Trac for tickets, you must have a GitHub account in order to login to Trac to create tickets.