From 5a8777ff45e0883befd63066f169f39d5fb4b791 Mon Sep 17 00:00:00 2001 From: Thomas O'Donnell Date: Sat, 5 Oct 2019 11:31:23 +0200 Subject: fix: Disable Kubernetes module by default (#488) Given the global nature of the Kubernetes module, the module has been disabled by default. The opportunity has also been taken to refactor the Kubernetes module to use the new config module. --- src/configs/kubernetes.rs | 34 ++++++++++++++++++++++++++++++++++ src/configs/mod.rs | 1 + 2 files changed, 35 insertions(+) create mode 100644 src/configs/kubernetes.rs (limited to 'src/configs') diff --git a/src/configs/kubernetes.rs b/src/configs/kubernetes.rs new file mode 100644 index 000000000..733919cd1 --- /dev/null +++ b/src/configs/kubernetes.rs @@ -0,0 +1,34 @@ +use crate::config::{ModuleConfig, RootModuleConfig, SegmentConfig}; + +use ansi_term::{Color, Style}; +use starship_module_config_derive::ModuleConfig; + +#[derive(Clone, ModuleConfig)] +pub struct KubernetesConfig<'a> { + pub symbol: SegmentConfig<'a>, + pub context: SegmentConfig<'a>, + pub namespace: SegmentConfig<'a>, + pub style: Style, + pub disabled: bool, +} + +impl<'a> RootModuleConfig<'a> for KubernetesConfig<'a> { + fn new() -> Self { + KubernetesConfig { + symbol: SegmentConfig { + value: "☸ ", + style: None, + }, + context: SegmentConfig { + value: "", + style: None, + }, + namespace: SegmentConfig { + value: "", + style: None, + }, + style: Color::Cyan.bold(), + disabled: true, + } + } +} diff --git a/src/configs/mod.rs b/src/configs/mod.rs index f557345e4..213ec36a5 100644 --- a/src/configs/mod.rs +++ b/src/configs/mod.rs @@ -2,6 +2,7 @@ pub mod aws; pub mod battery; pub mod character; pub mod dotnet; +pub mod kubernetes; pub mod rust; use crate::config::{ModuleConfig, RootModuleConfig}; -- cgit v1.2.3