mirror of https://github.com/sharkdp/fd.git
Added output status code to `format_exit_error` for debugging
This commit is contained in:
parent
3c0e254156
commit
4153925599
|
@ -77,10 +77,12 @@ fn find_fd_exe() -> PathBuf {
|
||||||
/// Format an error message for when *fd* did not exit successfully.
|
/// Format an error message for when *fd* did not exit successfully.
|
||||||
fn format_exit_error(args: &[&str], output: &process::Output) -> String {
|
fn format_exit_error(args: &[&str], output: &process::Output) -> String {
|
||||||
format!(
|
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(" "),
|
args.join(" "),
|
||||||
String::from_utf8_lossy(&output.stdout),
|
String::from_utf8_lossy(&output.stdout),
|
||||||
String::from_utf8_lossy(&output.stderr)
|
String::from_utf8_lossy(&output.stderr),
|
||||||
|
output.status.code()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -552,5 +552,5 @@ fn test_exec() {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Test executing 'diff' with the found result and itself.
|
// 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 New Issue