1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-26 11:42:36 +00:00
starship/src/configs/env_var.rs
David Knaack d06ba072a8
feat(config): allow printing default and computed config (#2521)
* feat: allow printing default and computed config

* fix custom modules

* actually fix custom modules
2021-03-31 17:31:55 +02:00

30 lines
762 B
Rust

use crate::config::ModuleConfig;
use serde::Serialize;
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig, Serialize)]
pub struct EnvVarConfig<'a> {
pub symbol: &'a str,
pub style: &'a str,
#[serde(skip_serializing_if = "Option::is_none")]
pub variable: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub default: Option<&'a str>,
pub format: &'a str,
pub disabled: bool,
}
impl<'a> Default for EnvVarConfig<'a> {
fn default() -> Self {
EnvVarConfig {
symbol: "",
style: "black bold dimmed",
variable: None,
default: None,
format: "with [$env_value]($style) ",
disabled: false,
}
}
}