]> git.r.bdr.sh - rbdr/blog/blame_incremental - src/command/update.rs
Add status command
[rbdr/blog] / src / command / update.rs
... / ...
CommitLineData
1use std::io::Result;
2use super::{sync_down::SyncDown, generate::Generate, sync_up::SyncUp};
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>> {
14 vec![Box::new(SyncDown::new())]
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>> {
23 vec![
24 Box::new(Generate::new()),
25 Box::new(SyncUp::new())
26 ]
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