]> git.r.bdr.sh - rbdr/blog/blame_incremental - src/command/add.rs
Add logic skeleton for rust version
[rbdr/blog] / src / command / add.rs
... / ...
CommitLineData
1use std::io::Result;
2
3pub struct Add;
4
5impl Add {
6 pub fn new() -> Self {
7 Add
8 }
9}
10
11impl super::Command for Add {
12 fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> {
13 vec![]
14 }
15
16 fn execute(&self, input: Option<&String>) -> Result<()> {
17 println!("Add: {:?}!", input);
18 return Ok(())
19 }
20
21 fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
22 vec![]
23 }
24
25 fn command(&self) -> &'static str {
26 "add"
27 }
28
29 fn help(&self) -> &'static str {
30 "<path_to_post>\t\tCreates new blog post"
31 }
32}