]> git.r.bdr.sh - rbdr/blog/blame - src/command/update.rs
Add status command
[rbdr/blog] / src / command / update.rs
CommitLineData
d620665f 1use std::io::Result;
5f81d796 2use super::{sync_down::SyncDown, generate::Generate, sync_up::SyncUp};
d620665f
RBR
3
4pub struct Update;
5
6impl Update {
7 pub fn new() -> Self {
8 Update
9 }
10}
11
12impl super::Command for Update {
13 fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> {
5f81d796 14 vec![Box::new(SyncDown::new())]
d620665f
RBR
15 }
16
17 fn execute(&self, input: Option<&String>) -> Result<()> {
18 println!("Update: {:?}!", input);
19 return Ok(())
20 }
21
22 fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
5f81d796
RBR
23 vec![
24 Box::new(Generate::new()),
25 Box::new(SyncUp::new())
26 ]
d620665f
RBR
27 }
28
29 fn command(&self) -> &'static str {
30 "update"
31 }
32
33 fn help(&self) -> &'static str {
34 "<path_to_post>\t\tUpdates latest blog post"
35 }
36}
37