summaryrefslogtreecommitdiffstats
path: root/src/configs/openstack.rs
diff options
context:
space:
mode:
authorMauricio Teixeira <mauricio.teixeira@gmail.com>2020-10-24 05:46:43 -0400
committerGitHub <noreply@github.com>2020-10-24 11:46:43 +0200
commiteec961caaf41407545e81b5fb89745db0f0fa751 (patch)
tree25bb60de1f899aff084ac62a450239efc336623f /src/configs/openstack.rs
parent745a554fdc5aeb4e238d6e7fb71154f8c48abda3 (diff)
feat(openstack): Add module for OpenStack (#1664)
* first (crude) attempt to implement the openstack module * Attempt to follow OpenStack standards for clouds.yaml location * fmt * provide unittest * add documentation * fix fmt * fix clippy * fix clippy * fix fmt * fix small nitpicks * expand openstack explanation * load config file using find_map * fix fmt * add test for valid config, plus fix test for invalid config * fix fmt * re-add forgotten comment
Diffstat (limited to 'src/configs/openstack.rs')
-rw-r--r--src/configs/openstack.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/configs/openstack.rs b/src/configs/openstack.rs
new file mode 100644
index 000000000..0517fa4bd
--- /dev/null
+++ b/src/configs/openstack.rs
@@ -0,0 +1,21 @@
+use crate::config::{ModuleConfig, RootModuleConfig};
+use starship_module_config_derive::ModuleConfig;
+
+#[derive(Clone, ModuleConfig)]
+pub struct OspConfig<'a> {
+ pub format: &'a str,
+ pub symbol: &'a str,
+ pub style: &'a str,
+ pub disabled: bool,
+}
+
+impl<'a> RootModuleConfig<'a> for OspConfig<'a> {
+ fn new() -> Self {
+ OspConfig {
+ format: "on [$symbol$cloud(\\($project\\))]($style) ",
+ symbol: "☁️ ",
+ style: "bold yellow",
+ disabled: false,
+ }
+ }
+}