mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-28 22:21:33 +02:00
Use Event Display impl in cli
This commit is contained in:
parent
5cbbb7b67f
commit
07f5e445f6
@ -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<RuntimeConfig> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user