2019-04-05 01:35:24 +00:00
|
|
|
mod character;
|
2019-04-05 00:35:35 +00:00
|
|
|
mod directory;
|
2019-04-27 02:07:07 +00:00
|
|
|
mod git_branch;
|
2019-04-05 00:35:35 +00:00
|
|
|
mod line_break;
|
2019-04-10 13:22:11 +00:00
|
|
|
mod nodejs;
|
2019-05-01 14:45:56 +00:00
|
|
|
mod package;
|
2019-04-25 15:06:18 +00:00
|
|
|
mod python;
|
2019-04-21 23:37:34 +00:00
|
|
|
mod rust;
|
2019-04-04 00:14:26 +00:00
|
|
|
|
2019-04-19 20:57:14 +00:00
|
|
|
use crate::context::Context;
|
2019-04-12 21:49:20 +00:00
|
|
|
use crate::segment::Segment;
|
2019-04-04 16:18:02 +00:00
|
|
|
|
2019-04-19 20:57:14 +00:00
|
|
|
pub fn handle(module: &str, context: &Context) -> Option<Segment> {
|
2019-04-04 00:14:26 +00:00
|
|
|
match module {
|
2019-04-19 20:57:14 +00:00
|
|
|
"dir" | "directory" => directory::segment(context),
|
|
|
|
"char" | "character" => character::segment(context),
|
|
|
|
"node" | "nodejs" => nodejs::segment(context),
|
2019-04-21 23:37:34 +00:00
|
|
|
"rust" | "rustlang" => rust::segment(context),
|
2019-04-25 15:06:18 +00:00
|
|
|
"python" => python::segment(context),
|
2019-04-19 20:57:14 +00:00
|
|
|
"line_break" => line_break::segment(context),
|
2019-05-01 14:45:56 +00:00
|
|
|
"package" => package::segment(context),
|
2019-04-27 02:07:07 +00:00
|
|
|
"git_branch" => git_branch::segment(context),
|
2019-04-04 00:14:26 +00:00
|
|
|
|
|
|
|
_ => panic!("Unknown module: {}", module),
|
|
|
|
}
|
|
|
|
}
|