2019-10-15 11:34:48 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
|
|
|
|
use ansi_term::{Color, Style};
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
2019-12-06 19:19:11 +00:00
|
|
|
pub struct DirectoryConfig<'a> {
|
2019-10-15 11:34:48 +00:00
|
|
|
pub truncation_length: i64,
|
|
|
|
pub truncate_to_repo: bool,
|
|
|
|
pub fish_style_pwd_dir_length: i64,
|
|
|
|
pub use_logical_path: bool,
|
2019-12-06 19:19:11 +00:00
|
|
|
pub prefix: &'a str,
|
2019-10-15 11:34:48 +00:00
|
|
|
pub style: Style,
|
|
|
|
pub disabled: bool,
|
|
|
|
}
|
|
|
|
|
2019-12-06 19:19:11 +00:00
|
|
|
impl<'a> RootModuleConfig<'a> for DirectoryConfig<'a> {
|
2019-10-15 11:34:48 +00:00
|
|
|
fn new() -> Self {
|
|
|
|
DirectoryConfig {
|
|
|
|
truncation_length: 3,
|
|
|
|
truncate_to_repo: true,
|
|
|
|
fish_style_pwd_dir_length: 0,
|
|
|
|
use_logical_path: true,
|
2019-12-06 19:19:11 +00:00
|
|
|
prefix: "in ",
|
2019-10-15 11:34:48 +00:00
|
|
|
style: Color::Cyan.bold(),
|
|
|
|
disabled: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|