]> git.r.bdr.sh - rbdr/blog/blame_incremental - src/command/status/mod.rs
Add manual file
[rbdr/blog] / src / command / status / mod.rs
... / ...
CommitLineData
1mod configuration_status;
2mod blog_status;
3
4use std::io::Result;
5use crate::configuration::Configuration;
6
7pub struct Status;
8
9impl Status {
10 pub fn new() -> Self {
11 Status
12 }
13}
14
15impl super::Command for Status {
16 fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> {
17 vec![]
18 }
19
20 fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> {
21 let status_providers = available_status_providers();
22 for status_provider in status_providers {
23 println!("{}\n----\n", status_provider(configuration));
24 }
25 return Ok(())
26 }
27
28 fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
29 vec![]
30 }
31
32 fn command(&self) -> &'static str {
33 "status"
34 }
35
36 fn help(&self) -> &'static str {
37 "\t\t\t\tPrints the status of your blog"
38 }
39}
40
41fn available_status_providers() -> Vec<fn(&Configuration) -> String> {
42 vec![
43 configuration_status::status,
44 blog_status::status,
45 ]
46}