summaryrefslogtreecommitdiffstats
path: root/src/configs/cmd_duration.rs
blob: f603901589284a5bf290c41274eef3ddb955476b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use crate::config::{ModuleConfig, RootModuleConfig};

use ansi_term::{Color, Style};
use starship_module_config_derive::ModuleConfig;

#[derive(Clone, ModuleConfig)]
pub struct CmdDurationConfig<'a> {
    pub min_time: i64,
    pub prefix: &'a str,
    pub style: Style,
    pub show_milliseconds: bool,
    pub disabled: bool,
}

impl<'a> RootModuleConfig<'a> for CmdDurationConfig<'a> {
    fn new() -> Self {
        CmdDurationConfig {
            min_time: 2_000,
            prefix: "took ",
            show_milliseconds: false,
            style: Color::Yellow.bold(),
            disabled: false,
        }
    }
}