From b47f2bf0004a063fb8112fbfd0b27193c79b28e3 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 1 Jan 2025 20:49:17 +0100 Subject: Output event descriptions if present. --- src/icaltool.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/icaltool.rs b/src/icaltool.rs index a98c4c8..d11c3d1 100644 --- a/src/icaltool.rs +++ b/src/icaltool.rs @@ -86,12 +86,14 @@ fn print_event(event: &IcalEvent) { let mut start: Option> = None; let mut end: Option> = None; let mut summary = String::new(); + let mut description = String::new(); for p in &event.properties { match p.name.as_ref() { "DTSTART" => start = parse_datetime(p.value.clone()), "DTEND" => end = parse_datetime(p.value.clone()), "SUMMARY" => summary = p.value.clone().unwrap_or_default(), + "DESCRIPTION" => description = p.value.clone().unwrap_or_default(), _ => (), } } @@ -100,6 +102,11 @@ fn print_event(event: &IcalEvent) { start.unwrap_or_else(Utc::now), end.unwrap_or_else(Utc::now), summary); + + if description.len() > 0 { + println!("{}", description); + } + } fn match_event(event: &IcalEvent, pattern: &str) -> bool { -- cgit v1.2.3