diff options
author | Matan Kushner <hello@matchai.me> | 2019-07-02 16:12:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-02 16:12:53 -0400 |
commit | 463ec260247fa0e62d2ea14e237681a499955392 (patch) | |
tree | 0d7ed8d19187c298c2e7764f21387a919d21877c /src/modules/directory.rs | |
parent | 2440ed60d0a315e6248c040d2a114f7deeea6260 (diff) |
feat: Add a `disabled` configuration option for modules (#86)
• Add support for the disabled configuration option
This will allow you to selectively disable modules that you don't want or need. 😄
• Overwrite starship configuration file path with STARSHIP_CONFIG environment variable
• Write tests for the two configuration options that are available
Diffstat (limited to 'src/modules/directory.rs')
-rw-r--r-- | src/modules/directory.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/directory.rs b/src/modules/directory.rs index 8e719c452..a2cafac16 100644 --- a/src/modules/directory.rs +++ b/src/modules/directory.rs @@ -12,12 +12,12 @@ use super::{Context, Module}; /// /// **Truncation** /// Paths will be limited in length to `3` path components by default. -pub fn segment<'a>(context: &'a Context) -> Option<Module<'a>> { +pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { const HOME_SYMBOL: &str = "~"; const DIR_TRUNCATION_LENGTH: usize = 3; let module_color = Color::Cyan.bold(); - let mut module = context.new_module("directory"); + let mut module = context.new_module("directory")?; module.set_style(module_color); let current_dir = &context.current_dir; |