2019-10-19 01:51:38 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
2020-07-07 22:45:32 +00:00
|
|
|
pub struct UsernameConfig<'a> {
|
|
|
|
pub format: &'a str,
|
|
|
|
pub style_root: &'a str,
|
|
|
|
pub style_user: &'a str,
|
2019-10-19 01:51:38 +00:00
|
|
|
pub show_always: bool,
|
|
|
|
pub disabled: bool,
|
|
|
|
}
|
|
|
|
|
2020-07-07 22:45:32 +00:00
|
|
|
impl<'a> RootModuleConfig<'a> for UsernameConfig<'a> {
|
2019-10-19 01:51:38 +00:00
|
|
|
fn new() -> Self {
|
|
|
|
UsernameConfig {
|
2020-09-08 16:09:21 +00:00
|
|
|
format: "[$user]($style) in ",
|
2020-07-07 22:45:32 +00:00
|
|
|
style_root: "red bold",
|
|
|
|
style_user: "yellow bold",
|
2019-10-19 01:51:38 +00:00
|
|
|
show_always: false,
|
|
|
|
disabled: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|