summaryrefslogtreecommitdiffstats
path: root/src/handlers/ripgrep_json.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2023-05-04 22:53:53 -0400
committerDan Davison <dandavison7@gmail.com>2023-06-02 14:36:30 -0700
commit83ca127e9e6a1e78d28e83c7ebe11ac1a5cc5faf (patch)
tree3fc27436d1d581e201de1b1654ebf0f085dbae02 /src/handlers/ripgrep_json.rs
parent46e44d3ba9396cf3256de6d592dcf8f17ba141c2 (diff)
Introduce grep-output-type option: ripgrep or classic
Diffstat (limited to 'src/handlers/ripgrep_json.rs')
-rw-r--r--src/handlers/ripgrep_json.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/handlers/ripgrep_json.rs b/src/handlers/ripgrep_json.rs
index 1a278a14..db3cfe82 100644
--- a/src/handlers/ripgrep_json.rs
+++ b/src/handlers/ripgrep_json.rs
@@ -22,6 +22,7 @@ pub fn parse_line(line: &str) -> Option<grep::GrepLine> {
}
}
Some(grep::GrepLine {
+ grep_type: crate::config::GrepType::Ripgrep,
line_type: ripgrep_line._type,
line_number: ripgrep_line.data.line_number,
path: Cow::from(ripgrep_line.data.path.text),
@@ -44,6 +45,7 @@ pub fn parse_line(line: &str) -> Option<grep::GrepLine> {
// ripgrep --json also emits these metadata lines at
// file boundaries. We emit nothing but signal that the
// line has been handled.
+ grep_type: crate::config::GrepType::Ripgrep,
line_type: grep::LineType::Ignore,
line_number: None,
path: "".into(),