mirror of
https://github.com/sharkdp/fd.git
synced 2024-09-28 13:01:30 +02:00
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.
|
||||
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()
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -552,5 +552,5 @@ fn test_exec() {
|
||||
);
|
||||
|
||||
// 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
Block a user