diff options
author | Thomas O'Donnell <andytom@users.noreply.github.com> | 2019-10-05 11:31:23 +0200 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-10-05 18:31:23 +0900 |
commit | 5a8777ff45e0883befd63066f169f39d5fb4b791 (patch) | |
tree | 4f736579cdc19eabe18943ca007930e5bd6800d1 /src/configs/kubernetes.rs | |
parent | 1bf60b3dd513a71eed6025ab1db483327e50cced (diff) |
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.
Diffstat (limited to 'src/configs/kubernetes.rs')
-rw-r--r-- | src/configs/kubernetes.rs | 34 |
1 files changed, 34 insertions, 0 deletions
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, + } + } +} |