mirror of
https://github.com/Llewellynvdm/starship.git
synced 2025-01-27 09:08:27 +00:00
29 lines
709 B
Rust
29 lines
709 B
Rust
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
pub struct TimeConfig<'a> {
|
|
pub format: &'a str,
|
|
pub style: &'a str,
|
|
pub use_12hr: bool,
|
|
pub time_format: Option<&'a str>,
|
|
pub disabled: bool,
|
|
pub utc_time_offset: &'a str,
|
|
pub time_range: &'a str,
|
|
}
|
|
|
|
impl<'a> RootModuleConfig<'a> for TimeConfig<'a> {
|
|
fn new() -> Self {
|
|
TimeConfig {
|
|
format: "at [$time]($style) ",
|
|
style: "bold yellow",
|
|
use_12hr: false,
|
|
time_format: None,
|
|
disabled: true,
|
|
utc_time_offset: "local",
|
|
time_range: "-",
|
|
}
|
|
}
|
|
}
|