mirror of
https://github.com/sharkdp/hyperfine.git
synced 2024-12-01 13:47:05 +03:00
Add command exit code to output if it fails
This commit is contained in:
parent
990ed45c3a
commit
c05d7f9480
@ -1,5 +1,7 @@
|
||||
# unreleased
|
||||
|
||||
- Add command exit code to output if it fails, see #342 (@KaindlJulian)
|
||||
|
||||
## Features
|
||||
|
||||
## Changes
|
||||
|
@ -63,9 +63,15 @@ pub fn time_shell_command(
|
||||
if failure_action == CmdFailureAction::RaiseError && !result.status.success() {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Command terminated with non-zero exit code. \
|
||||
format!(
|
||||
"{}. \
|
||||
Use the '-i'/'--ignore-failure' option if you want to ignore this. \
|
||||
Alternatively, use the '--show-output' option to debug what went wrong.",
|
||||
result.status.code().map_or(
|
||||
"The process has been terminated by a signal".into(),
|
||||
|c| format!("Command terminated with non-zero exit code: {}", c)
|
||||
)
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user