diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2025-01-01 20:49:17 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2025-01-01 20:49:17 +0100 |
commit | b47f2bf0004a063fb8112fbfd0b27193c79b28e3 (patch) | |
tree | ff2702d7a43b77b64e89bf4012317c60caf30c6b | |
parent | 7d184dedeca6dc356bf6544999727bafbb305fd5 (diff) | |
download | icaltool-b47f2bf0004a063fb8112fbfd0b27193c79b28e3.tar.gz icaltool-b47f2bf0004a063fb8112fbfd0b27193c79b28e3.tar.bz2 icaltool-b47f2bf0004a063fb8112fbfd0b27193c79b28e3.zip |
Output event descriptions if present.
-rw-r--r-- | src/icaltool.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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<DateTime<Utc>> = None; let mut end: Option<DateTime<Utc>> = 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 { |