starship/src/modules/mod.rs

33 lines
937 B
Rust
Raw Normal View History

2019-04-05 03:35:24 +02:00
mod character;
2019-04-05 02:35:35 +02:00
mod directory;
mod git_branch;
2019-05-14 06:43:11 +02:00
mod git_status;
2019-05-12 05:58:45 +02:00
mod go;
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;
mod username;
2019-04-04 02:14:26 +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-05-01 22:34:24 +02:00
pub fn handle(module: &str, context: &Context) -> Option<Module> {
2019-04-04 02:14:26 +02:00
match module {
"dir" | "directory" => directory::segment(context),
"char" | "character" => character::segment(context),
"node" | "nodejs" => nodejs::segment(context),
2019-04-22 01:37:34 +02:00
"rust" | "rustlang" => rust::segment(context),
2019-04-25 17:06:18 +02:00
"python" => python::segment(context),
2019-05-12 05:58:45 +02:00
"go" | "golang" => go::segment(context),
"line_break" => line_break::segment(context),
2019-05-01 16:45:56 +02:00
"package" => package::segment(context),
"git_branch" => git_branch::segment(context),
2019-05-14 06:43:11 +02:00
"git_status" => git_status::segment(context),
"username" => username::segment(context),
2019-04-04 02:14:26 +02:00
_ => panic!("Unknown module: {}", module),
}
}