List events

This commit is contained in:
clerie 2025-01-04 19:46:05 +01:00
parent f13575a66e
commit 6fadc916f4

View File

@ -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());
},