1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-09-29 05:29:11 +00:00
starship/src/configs/directory.rs
Zhenhui Xie be2d5cf1cd refactor: Rewrite cmd_duration, directory and env_var module to use module config (#460)
This PR is a batched rewrite of the following modules:
- cmd_duration
- directory
- env_var
2019-10-15 20:34:48 +09:00

28 lines
715 B
Rust

use crate::config::{ModuleConfig, RootModuleConfig};
use ansi_term::{Color, Style};
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig)]
pub struct DirectoryConfig {
pub truncation_length: i64,
pub truncate_to_repo: bool,
pub fish_style_pwd_dir_length: i64,
pub use_logical_path: bool,
pub style: Style,
pub disabled: bool,
}
impl<'a> RootModuleConfig<'a> for DirectoryConfig {
fn new() -> Self {
DirectoryConfig {
truncation_length: 3,
truncate_to_repo: true,
fish_style_pwd_dir_length: 0,
use_logical_path: true,
style: Color::Cyan.bold(),
disabled: false,
}
}
}