}
fn help(&self) -> &'static str {
- "<path_to_post>\t\tCreates new blog post"
+ "<path_to_post>\t\t\tCreates new blog post"
}
}
}
fn help(&self) -> &'static str {
- "\t\t\tGenerates the blog assets"
+ "\t\t\t\tGenerates the blog assets"
}
}
+use std::env::args;
use std::io::Result;
+use super::available_commands;
pub struct Help;
vec![]
}
- fn execute(&self, input: Option<&String>) -> Result<()> {
- println!("Help: {:?}!", input);
+ 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());
+ let commands = available_commands();
+ println!("Usage:");
+ println!("");
+ for command in commands {
+ print!("{} {} ", app_name, command.command());
+ println!("{}", command.help());
+ }
return Ok(())
}
}
fn help(&self) -> &'static str {
- "<destination>\tPublishes the blog to a remote host."
+ "<destination>\t\tPublishes the blog to a remote host"
}
}
}
fn help(&self) -> &'static str {
- "<destination>\tPublishes the archive to a remote host."
+ "<destination>\tPublishes the archive to a remote host"
}
}
}
fn help(&self) -> &'static str {
- "\t\t\tPulls from the git remote if configured"
+ "\t\t\t\tPulls from the git remote if configured"
}
}
}
fn help(&self) -> &'static str {
- "\t\t\t\tPushes to the git remote if configured."
+ "\t\t\t\tPushes to the git remote if configured"
}
}