From 963cd68cc4c4e9674b77aff316a0cfe8999eb82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Fri, 22 Oct 2021 05:48:37 +1300 Subject: [PATCH] Fix cli for ProcessEnd --- cli/src/config.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cli/src/config.rs b/cli/src/config.rs index 96eaaef5..cc586d28 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -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 { - 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); } _ => {} }