2019-10-15 11:34:48 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
|
|
pub struct CmdDurationConfig<'a> {
|
|
|
|
pub min_time: i64,
|
2020-07-07 22:45:32 +00:00
|
|
|
pub format: &'a str,
|
|
|
|
pub style: &'a str,
|
2019-12-19 22:38:06 +00:00
|
|
|
pub show_milliseconds: bool,
|
2019-10-15 11:34:48 +00:00
|
|
|
pub disabled: bool,
|
2020-08-11 16:44:25 +00:00
|
|
|
pub show_notifications: bool,
|
|
|
|
pub min_time_to_notify: i64,
|
2019-10-15 11:34:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> RootModuleConfig<'a> for CmdDurationConfig<'a> {
|
|
|
|
fn new() -> Self {
|
|
|
|
CmdDurationConfig {
|
2019-12-19 22:38:06 +00:00
|
|
|
min_time: 2_000,
|
2020-07-07 22:45:32 +00:00
|
|
|
format: "took [$duration]($style) ",
|
2019-12-19 22:38:06 +00:00
|
|
|
show_milliseconds: false,
|
2020-07-07 22:45:32 +00:00
|
|
|
style: "yellow bold",
|
2019-10-15 11:34:48 +00:00
|
|
|
disabled: false,
|
2020-08-11 16:44:25 +00:00
|
|
|
show_notifications: false,
|
|
|
|
min_time_to_notify: 45_000,
|
2019-10-15 11:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|