1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-16 23:32:22 +00:00
starship/src/configs/git_metrics.rs
filip 6b13296741
feat(git_metrics): Git metrics show only nonzero diffs (#2887)
* implement only_nonzero_diffs configuration option

* update documetation
2021-08-27 09:38:46 -05:00

26 lines
670 B
Rust

use crate::config::ModuleConfig;
use serde::Serialize;
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig, Serialize)]
pub struct GitMetricsConfig<'a> {
pub added_style: &'a str,
pub deleted_style: &'a str,
pub only_nonzero_diffs: bool,
pub format: &'a str,
pub disabled: bool,
}
impl<'a> Default for GitMetricsConfig<'a> {
fn default() -> Self {
GitMetricsConfig {
added_style: "bold green",
deleted_style: "bold red",
only_nonzero_diffs: true,
format: "([+$added]($added_style) )([-$deleted]($deleted_style) )",
disabled: true,
}
}
}