diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-09-25 15:01:27 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-09-25 15:01:29 -0400 |
commit | 9dc5464c84cf96c8e7cba96e2b470ebd066c2393 (patch) | |
tree | 4016714c5d55db24824f6c38139aa7877f3f8c60 /src/search_stream.rs | |
parent | 95edcd4d3a7c98d5679c890ed9875a17e54ca001 (diff) |
Stop after first match is found with --quiet.
Fixes #77.
Diffstat (limited to 'src/search_stream.rs')
-rw-r--r-- | src/search_stream.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/search_stream.rs b/src/search_stream.rs index 7b661808..0b5bfaf6 100644 --- a/src/search_stream.rs +++ b/src/search_stream.rs @@ -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)] |