Added delete-post subcommand

This commit is contained in:
Mahesh Bansod 2021-11-07 13:51:44 +05:30
parent 6fa77b8812
commit 1e293c67aa
1 changed files with 8 additions and 0 deletions

View File

@ -228,6 +228,7 @@ async fn main() {
for post in feed.iter() {
println!("================\n{}", post);
}
println!("----Retrieved {} post(s) from the timeline.\n", feed.len());
}
Err(err) => println!("{}", MyFriendlyError::from(err)),
},
@ -243,6 +244,10 @@ async fn main() {
Ok(post) => println!("{}", post),
Err(err) => println!("{}", MyFriendlyError::from(err)),
},
SocialVoidCommand::DeletePost { post_id } => match sv.timeline.delete(post_id).await {
Ok(_ok) => println!("Done"),
Err(err) => println!("{}", MyFriendlyError::from(err)),
},
SocialVoidCommand::Sync {} => {}
}
}
@ -305,6 +310,9 @@ enum SocialVoidCommand {
Unlike {
post_id: String,
},
DeletePost {
post_id: String,
},
Sync {},
}