X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/2f579cf4c0d8ff95af78103783c7ca8f951cc797..5080a41dec9423dceb43a5c7ded8b9e1ddc0817e:/src/command/help.rs?ds=sidebyside diff --git a/src/command/help.rs b/src/command/help.rs index 628fd5a..8d2a2c0 100644 --- a/src/command/help.rs +++ b/src/command/help.rs @@ -1,6 +1,6 @@ -use std::env::args; use std::io::Result; use super::available_commands; +use crate::configuration::Configuration; pub struct Help; @@ -15,14 +15,12 @@ impl super::Command for Help { vec![] } - fn execute(&self, _: Option<&String>) -> Result<()> { - let arguments: Vec = args().collect(); - let app_name = arguments.get(0).map_or("blog", |s| s.as_str()); + fn execute(&self, _: Option<&String>, _: &Configuration, _: &String) -> Result<()> { let commands = available_commands(); println!("Usage:"); println!(""); for command in commands { - print!("{} {} ", app_name, command.command()); + print!("blog {} ", command.command()); println!("{}", command.help()); } return Ok(())