mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-06-26 11:42:36 +00:00
d06ba072a8
* feat: allow printing default and computed config * fix custom modules * actually fix custom modules
30 lines
762 B
Rust
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,
|
|
}
|
|
}
|
|
}
|