mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 09:28:25 +01:00
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
1 changed files with 2 additions and 1 deletions
|
@ -208,6 +208,7 @@ fn construct_config(mut opts: Opts, pattern_regex: &str) -> Result<Config> {
|
|||
None
|
||||
};
|
||||
let command = extract_command(&mut opts, colored_output)?;
|
||||
let has_command = command.is_some();
|
||||
|
||||
Ok(Config {
|
||||
case_sensitive,
|
||||
|
@ -280,7 +281,7 @@ fn construct_config(mut opts: Opts, pattern_regex: &str) -> Result<Config> {
|
|||
actual_path_separator,
|
||||
max_results: opts.max_results(),
|
||||
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 a new issue