diff options
author | Tadej Novak <tadej@tano.si> | 2020-02-26 17:18:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 11:18:19 -0500 |
commit | 7e66791cb2228882530f55c48a79d2917953cb47 (patch) | |
tree | 841fe6a8f8968cedc35c2730333ff5cc1eba35de /src/configs | |
parent | 15f4202df1ca921fb71f72fcf33cd13582bfc945 (diff) |
feat: add singularity module (#932)
Diffstat (limited to 'src/configs')
-rw-r--r-- | src/configs/mod.rs | 1 | ||||
-rw-r--r-- | src/configs/singularity.rs | 27 | ||||
-rw-r--r-- | src/configs/starship_root.rs | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/src/configs/mod.rs b/src/configs/mod.rs index d3c6d4f37..af62804c1 100644 --- a/src/configs/mod.rs +++ b/src/configs/mod.rs @@ -27,6 +27,7 @@ pub mod php; pub mod python; pub mod ruby; pub mod rust; +pub mod singularity; mod starship_root; pub mod terraform; pub mod time; diff --git a/src/configs/singularity.rs b/src/configs/singularity.rs new file mode 100644 index 000000000..4ed192426 --- /dev/null +++ b/src/configs/singularity.rs @@ -0,0 +1,27 @@ +use crate::config::{ModuleConfig, RootModuleConfig, SegmentConfig}; + +use ansi_term::{Color, Style}; +use starship_module_config_derive::ModuleConfig; + +#[derive(Clone, ModuleConfig)] +pub struct SingularityConfig<'a> { + pub symbol: SegmentConfig<'a>, + pub label: &'a str, + pub prefix: &'a str, + pub suffix: &'a str, + pub style: Style, + pub disabled: bool, +} + +impl<'a> RootModuleConfig<'a> for SingularityConfig<'a> { + fn new() -> Self { + SingularityConfig { + symbol: SegmentConfig::default(), + label: "", + prefix: "[", + suffix: "]", + style: Color::Blue.bold().dimmed(), + disabled: false, + } + } +} diff --git a/src/configs/starship_root.rs b/src/configs/starship_root.rs index db024df71..f645c2c93 100644 --- a/src/configs/starship_root.rs +++ b/src/configs/starship_root.rs @@ -19,6 +19,7 @@ impl<'a> RootModuleConfig<'a> for StarshipRootConfig<'a> { prompt_order: vec![ "username", "hostname", + "singularity", "kubernetes", "directory", "git_branch", |