X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/d620665f6b2e1ae5db4c98a09e35bd63133ae87f..b17907faf8d9693cef94a6048d802bd4ced9102f:/src/command/help.rs?ds=inline diff --git a/src/command/help.rs b/src/command/help.rs index 9b98393..b682fc0 100644 --- a/src/command/help.rs +++ b/src/command/help.rs @@ -1,3 +1,5 @@ +use super::available_commands; +use crate::configuration::Configuration; use std::io::Result; pub struct Help; @@ -13,9 +15,15 @@ impl super::Command for Help { vec![] } - fn execute(&self, input: Option<&String>) -> Result<()> { - println!("Help: {:?}!", input); - return Ok(()) + fn execute(&self, _: Option<&String>, _: &Configuration, _: &str) -> Result<()> { + let commands = available_commands(); + println!("Usage:"); + println!(); + for command in commands { + print!("blog {} ", command.command()); + println!("{}", command.help()); + } + Ok(()) } fn after_dependencies(&self) -> Vec> {