]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/help.rs
Add logic skeleton for rust version
[rbdr/blog] / src / command / help.rs
diff --git a/src/command/help.rs b/src/command/help.rs
new file mode 100644 (file)
index 0000000..9b98393
--- /dev/null
@@ -0,0 +1,32 @@
+use std::io::Result;
+
+pub struct Help;
+
+impl Help {
+    pub fn new() -> Self {
+        Help
+    }
+}
+
+impl super::Command for Help {
+    fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> {
+        vec![]
+    }
+
+    fn execute(&self, input: Option<&String>) -> Result<()> {
+        println!("Help: {:?}!", input);
+        return Ok(())
+    }
+
+    fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
+        vec![]
+    }
+
+    fn command(&self) -> &'static str {
+        "help"
+    }
+
+    fn help(&self) -> &'static str {
+        "\t\t\t\tPrints this help"
+    }
+}