Display event content
This commit is contained in:
parent
6fadc916f4
commit
a7056f459e
26
src/main.rs
26
src/main.rs
@ -11,10 +11,27 @@ use etecal::session::{
|
||||
restore_etebase_session,
|
||||
};
|
||||
|
||||
#[derive(Subcommand, Clone)]
|
||||
#[command(arg_required_else_help = true)]
|
||||
enum EventCommands {
|
||||
Show,
|
||||
}
|
||||
|
||||
impl Default for EventCommands {
|
||||
fn default() -> Self {
|
||||
return Self::Show;
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Clone)]
|
||||
#[command(arg_required_else_help = true)]
|
||||
enum CalendarCommands {
|
||||
Events,
|
||||
Event {
|
||||
uid: String,
|
||||
#[command(subcommand)]
|
||||
command: Option<EventCommands>,
|
||||
},
|
||||
Name,
|
||||
SetName {
|
||||
name: String,
|
||||
@ -90,6 +107,15 @@ fn main() -> Result<()> {
|
||||
println!("{} [{}]", item.meta()?.name().unwrap(), item.uid());
|
||||
}
|
||||
},
|
||||
CalendarCommands::Event{uid, command} => {
|
||||
let item = item_manager.fetch(uid, None)?;
|
||||
|
||||
match &command.clone().unwrap_or_default() {
|
||||
EventCommands::Show => {
|
||||
println!("{}", String::from_utf8(item.content()?)?);
|
||||
},
|
||||
}
|
||||
},
|
||||
CalendarCommands::Name => {
|
||||
println!("{} [{}]", meta.name().unwrap(), collection.uid());
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user