diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-10-04 13:24:03 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-10-04 13:27:55 -0400 |
commit | 166d31a7d3ad410243405451cd2e0bd910f32c6e (patch) | |
tree | 3801b82c7b2c0c1cb2aa9a52239b4eea5084338e | |
parent | b920752c1d333d84a8e98d64ed989613709063f0 (diff) |
Make command a variable for use in error message
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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); }); |