1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-15 17:47:13 +00:00
starship/src/configs/git_commit.rs

26 lines
691 B
Rust

use crate::config::{ModuleConfig, RootModuleConfig};
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig)]
pub struct GitCommitConfig<'a> {
pub commit_hash_length: usize,
pub format: &'a str,
pub style: &'a str,
pub only_detached: bool,
pub disabled: bool,
}
impl<'a> RootModuleConfig<'a> for GitCommitConfig<'a> {
fn new() -> Self {
GitCommitConfig {
// be consistent with git by default, which has DEFAULT_ABBREV set to 7
commit_hash_length: 7,
format: "[\\($hash\\)]($style) ",
style: "green bold",
only_detached: true,
disabled: false,
}
}
}