starship/src/modules/mod.rs

27 lines
749 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-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-04-04 02:14:26 +02:00
use crate::context::Context;
2019-04-12 23:49:20 +02:00
use crate::segment::Segment;
2019-04-04 18:18:02 +02:00
pub fn handle(module: &str, context: &Context) -> Option<Segment> {
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),
"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-04-04 02:14:26 +02:00
_ => panic!("Unknown module: {}", module),
}
}