diff options
author | Matan Kushner <hello@matchai.me> | 2019-04-04 20:33:36 -0400 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-04-04 20:33:36 -0400 |
commit | 168d568d549cf55848a33921403f5f1be577742e (patch) | |
tree | c9c00921a4ad42cbd3bdf3877088cf587eab3cf0 /src/modules | |
parent | 52a529c62736d5186453f095b15b0ce038ec72a7 (diff) |
Add line_sep section
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/line_sep.rs | 13 | ||||
-rw-r--r-- | src/modules/mod.rs | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/modules/line_sep.rs b/src/modules/line_sep.rs new file mode 100644 index 000000000..dda14b8f8 --- /dev/null +++ b/src/modules/line_sep.rs @@ -0,0 +1,13 @@ +use super::Segment; +use clap::ArgMatches; + +/// Creates a segment for the line break +pub fn segment(_: &ArgMatches) -> Segment { + const LINE_ENDING: &str = "\n"; + + Segment { + value: String::from(LINE_ENDING), + suffix: None, + ..Default::default() + } +} diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 13b18fa13..e55ac6366 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -1,5 +1,6 @@ mod char; mod dir; +mod line_sep; use clap::ArgMatches; use ansi_term::Style; @@ -33,6 +34,7 @@ pub fn handle(module: &str, args: &ArgMatches) -> Segment { match module { "char" => char::segment(&args), "dir" => dir::segment(&args), + "line_sep" => line_sep::segment(&args), _ => panic!("Unknown module: {}", module), } |