Stop after first match is found with --quiet.

Fixes #77.
This commit is contained in:
Andrew Gallant
2016-09-25 15:01:27 -04:00
parent 95edcd4d3a
commit 9dc5464c84
6 changed files with 13 additions and 4 deletions

View File

@@ -265,7 +265,8 @@ impl<'a, R: io::Read, W: Terminal + Send> Searcher<'a, R, W> {
#[inline(always)]
fn terminate(&self) -> bool {
return self.opts.files_with_matches && self.match_count > 0;
self.match_count > 0
&& (self.printer.is_quiet() || self.opts.files_with_matches)
}
#[inline(always)]