mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-21 23:23:47 -07:00
printer: fix handling of has_match
for summary printer
Previously, `Quiet` mode in the summary printer always acted like "print matching paths," except without the printing. This happened even if we wanted to "print non-matching paths." Since this only afflicted quiet mode, this had the effect of flipping the exit status when `--files-without-match --quiet` was used. Fixes #3108, Ref #3118
This commit is contained in:
@@ -562,7 +562,16 @@ impl HiArgs {
|
||||
wtr: W,
|
||||
) -> Printer<W> {
|
||||
let summary_kind = if self.quiet {
|
||||
SummaryKind::Quiet
|
||||
match search_mode {
|
||||
SearchMode::FilesWithMatches
|
||||
| SearchMode::Count
|
||||
| SearchMode::CountMatches
|
||||
| SearchMode::JSON
|
||||
| SearchMode::Standard => SummaryKind::QuietWithMatch,
|
||||
SearchMode::FilesWithoutMatch => {
|
||||
SummaryKind::QuietWithoutMatch
|
||||
}
|
||||
}
|
||||
} else {
|
||||
match search_mode {
|
||||
SearchMode::FilesWithMatches => SummaryKind::PathWithMatch,
|
||||
|
Reference in New Issue
Block a user