mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
feat: Add the git_metrics module (#2827)
This PR adds a new module named git_metrics. It shows the added/deleted lines in the current git repository following the format: "[+$added_lines]($added_style) [-$deleted_lines]($deleted_style)".
This commit is contained in:
committed by
GitHub
parent
9126d78d0e
commit
9f337d15e7
@@ -0,0 +1,23 @@
|
||||
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 format: &'a str,
|
||||
pub disabled: bool,
|
||||
}
|
||||
|
||||
impl<'a> Default for GitMetricsConfig<'a> {
|
||||
fn default() -> Self {
|
||||
GitMetricsConfig {
|
||||
added_style: "bold green",
|
||||
deleted_style: "bold red",
|
||||
format: "[+$added]($added_style) [-$deleted]($deleted_style) ",
|
||||
disabled: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user