summaryrefslogtreecommitdiffstats
path: root/src/modules/mod.rs
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.me>2019-04-04 14:18:15 -0400
committerMatan Kushner <hello@matchai.me>2019-04-04 14:18:15 -0400
commit7683f33bc870cd928e7d572fcdde65a1fd5eda0c (patch)
treecb63e0a03225633c884f1dc0335159dfef7207d9 /src/modules/mod.rs
parenta81eabd690f171cda1738b37de3266993712c714 (diff)
Add dir section with home truncation
Diffstat (limited to 'src/modules/mod.rs')
-rw-r--r--src/modules/mod.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/mod.rs b/src/modules/mod.rs
index 869a82c2c..13b18fa13 100644
--- a/src/modules/mod.rs
+++ b/src/modules/mod.rs
@@ -1,4 +1,5 @@
mod char;
+mod dir;
use clap::ArgMatches;
use ansi_term::Style;
@@ -12,11 +13,18 @@ pub struct Segment {
impl Default for Segment {
fn default() -> Segment {
+ let default_suffix = Some(Box::new(Segment {
+ style: Style::default(),
+ value: String::from(" "),
+ prefix: None,
+ suffix: None
+ }));
+
Segment {
style: Style::default(),
value: String::from(""),
prefix: None,
- suffix: None
+ suffix: default_suffix
}
}
}
@@ -24,6 +32,7 @@ impl Default for Segment {
pub fn handle(module: &str, args: &ArgMatches) -> Segment {
match module {
"char" => char::segment(&args),
+ "dir" => dir::segment(&args),
_ => panic!("Unknown module: {}", module),
}