I needed to grep for a JSON value across a large collection of files, and found myself doing find . -type f -exec gron {} \; | grep whatever, but then I couldn't identify which files contained the matches. grep has a -H / --with-filename option, that prefixes each output line with filename: fro just such uses (e.g., with grep -r), and that seemed like the right answer. This change adds that option to gron, using "-" for the filename when the input is stdin.
It's been several years since I created this PR, but if the gron maintainers are interested in mergong it, I'll make sure the changes are compatible with the current source.
I needed to grep for a JSON value across a large collection of files, and found myself doing
find . -type f -exec gron {} \; | grep whatever
, but then I couldn't identify which files contained the matches.grep
has a -H / --with-filename option, that prefixes each output line withfilename:
fro just such uses (e.g., withgrep -r
), and that seemed like the right answer. This change adds that option togron
, using "-" for the filename when the input is stdin.