2019-05-22 18:29:39 +02:00
|
|
|
mod battery;
|
2019-04-05 03:35:24 +02:00
|
|
|
mod character;
|
2019-08-08 19:25:30 +02:00
|
|
|
mod cmd_duration;
|
2019-04-05 02:35:35 +02:00
|
|
|
mod directory;
|
2019-04-27 04:07:07 +02:00
|
|
|
mod git_branch;
|
2019-05-14 06:43:11 +02:00
|
|
|
mod git_status;
|
2019-07-19 22:18:52 +02:00
|
|
|
mod golang;
|
2019-08-12 19:42:33 +02:00
|
|
|
mod jobs;
|
2019-04-05 02:35:35 +02:00
|
|
|
mod line_break;
|
2019-04-10 15:22:11 +02:00
|
|
|
mod nodejs;
|
2019-05-01 16:45:56 +02:00
|
|
|
mod package;
|
2019-04-25 17:06:18 +02:00
|
|
|
mod python;
|
2019-04-22 01:37:34 +02:00
|
|
|
mod rust;
|
2019-05-20 04:26:12 +02:00
|
|
|
mod username;
|
2019-04-04 02:14:26 +02:00
|
|
|
|
2019-04-19 22:57:14 +02:00
|
|
|
use crate::context::Context;
|
2019-05-01 22:34:24 +02:00
|
|
|
use crate::module::Module;
|
2019-04-04 18:18:02 +02:00
|
|
|
|
2019-06-10 16:56:17 +02:00
|
|
|
pub fn handle<'a>(module: &str, context: &'a Context) -> Option<Module<'a>> {
|
2019-04-04 02:14:26 +02:00
|
|
|
match module {
|
2019-08-13 18:30:59 +02:00
|
|
|
"directory" => directory::module(context),
|
|
|
|
"character" => character::module(context),
|
|
|
|
"nodejs" => nodejs::module(context),
|
|
|
|
"rust" => rust::module(context),
|
2019-07-02 22:12:53 +02:00
|
|
|
"python" => python::module(context),
|
2019-08-13 18:30:59 +02:00
|
|
|
"golang" => golang::module(context),
|
2019-07-02 22:12:53 +02:00
|
|
|
"line_break" => line_break::module(context),
|
|
|
|
"package" => package::module(context),
|
|
|
|
"git_branch" => git_branch::module(context),
|
|
|
|
"git_status" => git_status::module(context),
|
|
|
|
"username" => username::module(context),
|
|
|
|
"battery" => battery::module(context),
|
2019-08-08 19:25:30 +02:00
|
|
|
"cmd_duration" => cmd_duration::module(context),
|
2019-08-12 19:42:33 +02:00
|
|
|
"jobs" => jobs::module(context),
|
2019-04-04 02:14:26 +02:00
|
|
|
|
|
|
|
_ => panic!("Unknown module: {}", module),
|
|
|
|
}
|
|
|
|
}
|