mirror of https://github.com/sharkdp/fd.git
Actually test if exec or exec-batch is used
By the time we check if we should strip the cwd, we've already moved the command out of the options, so store if we got that out earlier.
This commit is contained in:
parent
86c33492a7
commit
aca64c09f8
|
@ -208,6 +208,7 @@ fn construct_config(mut opts: Opts, pattern_regex: &str) -> Result<Config> {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
let command = extract_command(&mut opts, colored_output)?;
|
let command = extract_command(&mut opts, colored_output)?;
|
||||||
|
let has_command = command.is_some();
|
||||||
|
|
||||||
Ok(Config {
|
Ok(Config {
|
||||||
case_sensitive,
|
case_sensitive,
|
||||||
|
@ -280,7 +281,7 @@ fn construct_config(mut opts: Opts, pattern_regex: &str) -> Result<Config> {
|
||||||
actual_path_separator,
|
actual_path_separator,
|
||||||
max_results: opts.max_results(),
|
max_results: opts.max_results(),
|
||||||
strip_cwd_prefix: (opts.no_search_paths()
|
strip_cwd_prefix: (opts.no_search_paths()
|
||||||
&& (opts.strip_cwd_prefix || !(opts.null_separator || opts.exec.command.is_some()))),
|
&& (opts.strip_cwd_prefix || !(opts.null_separator || has_command))),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue