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