]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/help.rs
Add release
[rbdr/blog] / src / command / help.rs
index 9b98393d0c49872d8831b7578bad8dfa6e530fad..8d2a2c0adb7ee111d0280056e83448a5d4991224 100644 (file)
@@ -1,4 +1,6 @@
 use std::io::Result;
 use std::io::Result;
+use super::available_commands;
+use crate::configuration::Configuration;
 
 pub struct Help;
 
 
 pub struct Help;
 
@@ -13,8 +15,14 @@ impl super::Command for Help {
         vec![]
     }
 
         vec![]
     }
 
-    fn execute(&self, input: Option<&String>) -> Result<()> {
-        println!("Help: {:?}!", input);
+    fn execute(&self, _: Option<&String>, _: &Configuration, _: &String) -> Result<()> {
+        let commands = available_commands();
+        println!("Usage:");
+        println!("");
+        for command in commands {
+            print!("blog {} ", command.command());
+            println!("{}", command.help());
+        }
         return Ok(())
     }
 
         return Ok(())
     }