-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A flag to make --count return 0 #1370
Comments
BurntSushi
pushed a commit
that referenced
this issue
Feb 15, 2020
This flag, when used in conjunction with --count or --count-matches, will print a result for each file searched even if there were zero matches in that file. This is off by default but can be enabled to make ripgrep behave more like grep. This also clarifies some of the defaults for the grep-printer::SummaryBuilder type. Closes #1370, Closes #1405
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of ripgrep are you using?
ripgrep 11.0.1 (rev 973de50)
How did you install ripgrep?
Github binary release.
What operating system are you using ripgrep on?
Linux.
Describe your question, feature request, or bug.
With
grep -cH needle app.log*
, you get something like:which is visually useful for cases such as "interesting things happened on 25th and 26th, but not on 24th and 27th".
The difference is in the "not on 24th and 27th" part - without
rg
outputting zero counts it's not possible to distinguish between:It might be good to consider a flag to include zero counts as well. IMO it would help with sanity double-checks.
The text was updated successfully, but these errors were encountered: