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

31 lines
823 B
Rust
Raw Normal View History

use crate::config::ModuleConfig;
2019-12-06 16:57:42 +00:00
use serde::Serialize;
2019-12-06 16:57:42 +00:00
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig, Serialize)]
2019-12-06 16:57:42 +00:00
pub struct GitCommitConfig<'a> {
pub commit_hash_length: usize,
pub format: &'a str,
pub style: &'a str,
pub only_detached: bool,
2019-12-06 16:57:42 +00:00
pub disabled: bool,
pub tag_symbol: &'a str,
pub tag_disabled: bool,
2019-12-06 16:57:42 +00:00
}
impl<'a> Default for GitCommitConfig<'a> {
fn default() -> Self {
2019-12-06 16:57:42 +00:00
GitCommitConfig {
// be consistent with git by default, which has DEFAULT_ABBREV set to 7
commit_hash_length: 7,
format: "[\\($hash$tag\\)]($style) ",
style: "green bold",
only_detached: true,
disabled: false,
tag_symbol: " 🏷 ",
tag_disabled: true,
2019-12-06 16:57:42 +00:00
}
}
}