X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/d620665f6b2e1ae5db4c98a09e35bd63133ae87f..f7f4335199beaad56d9c962ac84e92a3f78907a6:/src/command/help.rs?ds=sidebyside diff --git a/src/command/help.rs b/src/command/help.rs index 9b98393..8d2a2c0 100644 --- a/src/command/help.rs +++ b/src/command/help.rs @@ -1,4 +1,6 @@ use std::io::Result; +use super::available_commands; +use crate::configuration::Configuration; pub struct Help; @@ -13,8 +15,14 @@ impl super::Command for Help { 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(()) }