mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 17:35:16 +01:00
Added output status code to format_exit_error
for debugging
This commit is contained in:
parent
3c0e254156
commit
4153925599
2 changed files with 6 additions and 4 deletions
|
@ -77,10 +77,12 @@ fn find_fd_exe() -> PathBuf {
|
|||
/// Format an error message for when *fd* did not exit successfully.
|
||||
fn format_exit_error(args: &[&str], output: &process::Output) -> String {
|
||||
format!(
|
||||
"`fd {}` did not exit successfully.\nstdout:\n---\n{}---\nstderr:\n---\n{}---",
|
||||
"`fd {}` did not exit successfully.\nstdout:\n---\n{}---\nstderr:\n---\n{}---\n
|
||||
code:\n---\n{:?}---\n",
|
||||
args.join(" "),
|
||||
String::from_utf8_lossy(&output.stdout),
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
String::from_utf8_lossy(&output.stderr),
|
||||
output.status.code()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -550,7 +550,7 @@ fn test_exec() {
|
|||
Comparing files a.foo and A.FOO
|
||||
FC: no differences encountered",
|
||||
);
|
||||
|
||||
|
||||
// Test executing 'diff' with the found result and itself.
|
||||
#[cfg(unix)] te.assert_output(&["--exec", "diff {} {}", "a.foo"],"");
|
||||
#[cfg(unix)] te.assert_output(&["--exec", "diff {} {}", "a.foo"], "");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue