3 use super::available_commands;
13 impl super::Command for Help {
14 fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> {
18 fn execute(&self, _: Option<&String>) -> Result<()> {
19 let arguments: Vec<String> = args().collect();
20 let app_name = arguments.get(0).map_or("blog", |s| s.as_str());
21 let commands = available_commands();
24 for command in commands {
25 print!("{} {} ", app_name, command.command());
26 println!("{}", command.help());
31 fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
35 fn command(&self) -> &'static str {
39 fn help(&self) -> &'static str {
40 "\t\t\t\tPrints this help"