mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-29 22:51:33 +02:00
Fix cli for ProcessEnd
This commit is contained in:
parent
470cdd698b
commit
963cd68cc4
@ -9,6 +9,7 @@ use watchexec::{
|
|||||||
action::{Action, Outcome},
|
action::{Action, Outcome},
|
||||||
command::Shell,
|
command::Shell,
|
||||||
config::{InitConfig, RuntimeConfig},
|
config::{InitConfig, RuntimeConfig},
|
||||||
|
event::ProcessEnd,
|
||||||
filter::tagged::TaggedFilterer,
|
filter::tagged::TaggedFilterer,
|
||||||
fs::Watcher,
|
fs::Watcher,
|
||||||
handler::PrintDisplay,
|
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();
|
let completion = action.events.iter().flat_map(|e| e.completions()).next();
|
||||||
if let Some(status) = completion {
|
if let Some(status) = completion {
|
||||||
match status {
|
match status {
|
||||||
Some(ex) if !ex.success() => {
|
Some(ProcessEnd::ExitError(code)) => {
|
||||||
eprintln!("[Command exited with {}]", ex);
|
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 New Issue
Block a user