From 5f81d796fed4e4efbaf6dbed7d3c69481afddeb3 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sat, 24 Feb 2024 23:20:14 +0000 Subject: Add status command --- src/command/status/mod.rs | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/command/status/mod.rs (limited to 'src/command/status/mod.rs') diff --git a/src/command/status/mod.rs b/src/command/status/mod.rs new file mode 100644 index 0000000..ba73184 --- /dev/null +++ b/src/command/status/mod.rs @@ -0,0 +1,43 @@ +mod configuration_status; + +use std::io::Result; + +pub struct Status; + +impl Status { + pub fn new() -> Self { + Status + } +} + +impl super::Command for Status { + fn before_dependencies(&self) -> Vec> { + vec![] + } + + fn execute(&self, _: Option<&String>) -> Result<()> { + let status_providers = available_status_providers(); + for status_provider in status_providers { + println!("{}", status_provider()); + } + return Ok(()) + } + + fn after_dependencies(&self) -> Vec> { + vec![] + } + + fn command(&self) -> &'static str { + "status" + } + + fn help(&self) -> &'static str { + "\t\t\t\tPrints the status of your blog" + } +} + +fn available_status_providers() -> Vec String> { + vec![ + configuration_status::status, + ] +} -- cgit