From 6fadc916f4d5a1980a6bf7f31722ca8c8ad907c9 Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 4 Jan 2025 19:46:05 +0100 Subject: [PATCH] List events --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index 36033d0..de87924 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,7 @@ use etecal::session::{ #[derive(Subcommand, Clone)] #[command(arg_required_else_help = true)] enum CalendarCommands { + Events, Name, SetName { name: String, @@ -81,7 +82,14 @@ fn main() -> Result<()> { let mut collection = collection_manager.fetch(uid, None)?; let mut meta = collection.meta()?; + let item_manager = collection_manager.item_manager(&collection)?; + match &command.clone().unwrap_or_default() { + CalendarCommands::Events => { + for item in item_manager.list(None)?.data() { + println!("{} [{}]", item.meta()?.name().unwrap(), item.uid()); + } + }, CalendarCommands::Name => { println!("{} [{}]", meta.name().unwrap(), collection.uid()); },