1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-10 12:22:21 +00:00
starship/src/configs/meson.rs
Jamie 355800f814
feat(module): Add a meson devenv indicator (#4389)
* feat(module): Add a meson devenv indicator

Adds a Meson Developer Environment indicator, if the MESON_DEVENV
variable is set. Inside a `meson devenv`, the prompt will include the
current Meson project name

This also contains a new Truncate utility function, which may be adapted for other modules in the future

* docs: Add Meson to presets
2022-10-11 18:02:46 +02:00

31 lines
742 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Clone, Deserialize, Serialize)]
#[cfg_attr(
feature = "config-schema",
derive(schemars::JsonSchema),
schemars(deny_unknown_fields)
)]
#[serde(default)]
pub struct MesonConfig<'a> {
pub truncation_length: u32,
pub truncation_symbol: &'a str,
pub format: &'a str,
pub symbol: &'a str,
pub style: &'a str,
pub disabled: bool,
}
impl<'a> Default for MesonConfig<'a> {
fn default() -> Self {
MesonConfig {
truncation_length: std::u32::MAX,
truncation_symbol: "",
format: "via [$symbol$project]($style) ",
symbol: "",
style: "blue bold",
disabled: false,
}
}
}