summaryrefslogtreecommitdiffstats
path: root/crates/core
diff options
context:
space:
mode:
Diffstat (limited to 'crates/core')
-rw-r--r--crates/core/args.rs2
-rw-r--r--crates/core/search.rs11
2 files changed, 9 insertions, 4 deletions
diff --git a/crates/core/args.rs b/crates/core/args.rs
index e889f7d2..9c490e4e 100644
--- a/crates/core/args.rs
+++ b/crates/core/args.rs
@@ -290,7 +290,7 @@ impl Args {
let mut builder = SearchWorkerBuilder::new();
builder
.json_stats(matches.is_present("json"))
- .preprocessor(matches.preprocessor())
+ .preprocessor(matches.preprocessor())?
.preprocessor_globs(matches.preprocessor_globs()?)
.search_zip(matches.is_present("search-zip"))
.binary_detection_implicit(matches.binary_detection_implicit())
diff --git a/crates/core/search.rs b/crates/core/search.rs
index 4da4057b..c57e9ee6 100644
--- a/crates/core/search.rs
+++ b/crates/core/search.rs
@@ -115,9 +115,14 @@ impl SearchWorkerBuilder {
pub fn preprocessor(
&mut self,
cmd: Option<PathBuf>,
- ) -> &mut SearchWorkerBuilder {
- self.config.preprocessor = cmd;
- self
+ ) -> crate::Result<&mut SearchWorkerBuilder> {
+ if let Some(ref prog) = cmd {
+ let bin = cli::resolve_binary(prog)?;
+ self.config.preprocessor = Some(bin);
+ } else {
+ self.config.preprocessor = None;
+ }
+ Ok(self)
}
/// Set the globs for determining which files should be run through the