mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-13 07:41:11 +01:00
Fix cli for ProcessEnd
This commit is contained in:
parent
470cdd698b
commit
963cd68cc4
1 changed files with 15 additions and 2 deletions
|
@ -9,6 +9,7 @@ use watchexec::{
|
|||
action::{Action, Outcome},
|
||||
command::Shell,
|
||||
config::{InitConfig, RuntimeConfig},
|
||||
event::ProcessEnd,
|
||||
filter::tagged::TaggedFilterer,
|
||||
fs::Watcher,
|
||||
handler::PrintDisplay,
|
||||
|
@ -146,8 +147,20 @@ fn runtime(args: &ArgMatches<'static>) -> Result<(RuntimeConfig, Arc<TaggedFilte
|
|||
let completion = action.events.iter().flat_map(|e| e.completions()).next();
|
||||
if let Some(status) = completion {
|
||||
match status {
|
||||
Some(ex) if !ex.success() => {
|
||||
eprintln!("[Command exited with {}]", ex);
|
||||
Some(ProcessEnd::ExitError(code)) => {
|
||||
eprintln!("[Command exited with {}]", code);
|
||||
}
|
||||
Some(ProcessEnd::ExitSignal(sig)) => {
|
||||
eprintln!("[Command killed by {:?}]", sig);
|
||||
}
|
||||
Some(ProcessEnd::ExitStop(sig)) => {
|
||||
eprintln!("[Command stopped by {:?}]", sig);
|
||||
}
|
||||
Some(ProcessEnd::Continued) => {
|
||||
eprintln!("[Command continued]");
|
||||
}
|
||||
Some(ProcessEnd::Exception(ex)) => {
|
||||
eprintln!("[Command ended by exception {:#x}]", ex);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue