From c42bf4b904d5b491f6fe027102df5f2c77f66efe Mon Sep 17 00:00:00 2001 From: Jonah Caplan Date: Sat, 16 Oct 2021 14:15:37 -0400 Subject: [PATCH] don't strip paths for -X/x, and for tty output --- src/exec/mod.rs | 5 +---- src/main.rs | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/exec/mod.rs b/src/exec/mod.rs index a364e86..15e1ae5 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -14,7 +14,6 @@ use lazy_static::lazy_static; use regex::Regex; use crate::exit_codes::ExitCode; -use crate::filesystem::strip_current_dir; use self::command::execute_command; use self::input::{basename, dirname, remove_extension}; @@ -145,8 +144,6 @@ impl CommandTemplate { out_perm: Arc>, buffer_output: bool, ) -> ExitCode { - let input = strip_current_dir(input); - let mut cmd = Command::new(self.args[0].generate(&input, self.path_separator.as_deref())); for arg in &self.args[1..] { cmd.arg(arg.generate(&input, self.path_separator.as_deref())); @@ -178,7 +175,7 @@ impl CommandTemplate { // A single `Tokens` is expected // So we can directly consume the iterator once and for all for path in &mut paths { - cmd.arg(arg.generate(strip_current_dir(path), self.path_separator.as_deref())); + cmd.arg(arg.generate(path, self.path_separator.as_deref())); has_path = true; } } else { diff --git a/src/main.rs b/src/main.rs index 47e68bd..43a6e2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -250,6 +250,8 @@ fn construct_config(matches: clap::ArgMatches, pattern_regex: &str) -> Result Result