-use std::env::args;
-use std::io::Result;
use super::available_commands;
+use crate::configuration::Configuration;
+use std::io::Result;
pub struct Help;
vec![]
}
- fn execute(&self, _: Option<&String>) -> Result<()> {
- let arguments: Vec<String> = args().collect();
- let app_name = arguments.get(0).map_or("blog", |s| s.as_str());
+ fn execute(&self, _: Option<&String>, _: &Configuration, _: &str) -> Result<()> {
let commands = available_commands();
println!("Usage:");
- println!("");
+ println!();
for command in commands {
- print!("{} {} ", app_name, command.command());
+ print!("blog {} ", command.command());
println!("{}", command.help());
}
- return Ok(())
+ Ok(())
}
fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {