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,
|
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)]
|
#[derive(Subcommand, Clone)]
|
||||||
#[command(arg_required_else_help = true)]
|
#[command(arg_required_else_help = true)]
|
||||||
enum CalendarCommands {
|
enum CalendarCommands {
|
||||||
Events,
|
Events,
|
||||||
|
Event {
|
||||||
|
uid: String,
|
||||||
|
#[command(subcommand)]
|
||||||
|
command: Option<EventCommands>,
|
||||||
|
},
|
||||||
Name,
|
Name,
|
||||||
SetName {
|
SetName {
|
||||||
name: String,
|
name: String,
|
||||||
@ -90,6 +107,15 @@ fn main() -> Result<()> {
|
|||||||
println!("{} [{}]", item.meta()?.name().unwrap(), item.uid());
|
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 => {
|
CalendarCommands::Name => {
|
||||||
println!("{} [{}]", meta.name().unwrap(), collection.uid());
|
println!("{} [{}]", meta.name().unwrap(), collection.uid());
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user