From 166d31a7d3ad410243405451cd2e0bd910f32c6e Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sun, 4 Oct 2020 13:24:03 -0400 Subject: Make command a variable for use in error message --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 9a93ecdd..a691c331 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,7 +102,8 @@ fn diff( eprintln!("Usage: delta minus_file plus_file"); process::exit(1); }; - let diff_process = process::Command::new(PathBuf::from("diff")) + let command = "diff"; + let diff_process = process::Command::new(PathBuf::from(command)) .arg("-u") .args(&[ minus_file.unwrap_or_else(die), @@ -111,7 +112,7 @@ fn diff( .stdout(process::Stdio::piped()) .spawn() .unwrap_or_else(|err| { - eprintln!("Failed to execute the command: diff: {}", err); + eprintln!("Failed to execute the command '{}': {}", command, err); process::exit(1); }); -- cgit v1.2.3