1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-15 17:47:13 +00:00
starship/src/configs/kubernetes.rs
Matan Kushner d3100c5c82
fix: use suffixes for modules before directory (#1645)
Previously, all modules would have prefixes, which lead to the first
module having a dangling prefix. This change ensures that the first
few modules would instead have suffixes so that we don't start or
end with a prefix or suffix.
2020-09-08 12:09:21 -04:00

26 lines
682 B
Rust

use crate::config::{ModuleConfig, RootModuleConfig};
use starship_module_config_derive::ModuleConfig;
use std::collections::HashMap;
#[derive(Clone, ModuleConfig)]
pub struct KubernetesConfig<'a> {
pub symbol: &'a str,
pub format: &'a str,
pub style: &'a str,
pub disabled: bool,
pub context_aliases: HashMap<String, &'a str>,
}
impl<'a> RootModuleConfig<'a> for KubernetesConfig<'a> {
fn new() -> Self {
KubernetesConfig {
symbol: "",
format: "[$symbol$context( \\($namespace\\))]($style) in ",
style: "cyan bold",
disabled: true,
context_aliases: HashMap::new(),
}
}
}