From 07f5e445f63feddffc965e24ccf3d58106a7d083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Fri, 3 Sep 2021 07:58:20 +1200 Subject: [PATCH] Use Event Display impl in cli --- cli/src/config.rs | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/cli/src/config.rs b/cli/src/config.rs index 8804e17..803a8e4 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -8,7 +8,6 @@ use watchexec::{ action::{Action, Outcome, Signal}, command::Shell, config::{InitConfig, RuntimeConfig}, - event::{Event, Particle}, fs::Watcher, handler::PrintDisplay, signal::Signal as InputSignal, @@ -96,34 +95,7 @@ fn runtime(args: &ArgMatches<'static>) -> Result { if print_events { for (n, event) in action.events.iter().enumerate() { - for path in event.paths() { - eprintln!( - "[EVENT {}] Path: {} -- {:?}", - n, - path.display(), - event.metadata - ); - } - - for signal in event.signals() { - eprintln!("[EVENT {}] Signal: {:?} -- {:?}", n, signal, event.metadata); - } - - for com in event - .particulars - .iter() - .filter(|p| matches!(p, Particle::ProcessCompletion(_))) - { - if let Particle::ProcessCompletion(Some(status)) = com { - eprintln!("[EVENT {}] Process Finished with {}", n, status); - } else { - eprintln!("[EVENT {}] Process Finished", n); - } - } - - if event == &Event::default() { - eprintln!("[EVENT {}] Empty -- {:?}", n, event.metadata); - } + eprintln!("[EVENT {}] {}", n, event); } }