summaryrefslogtreecommitdiffstats
path: root/src/modules/mod.rs
blob: 2a9f433bbdff73f60c6b303a981ebfb37a7436a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mod character;
mod directory;
mod git_branch;
mod go;
mod line_break;
mod nodejs;
mod package;
mod python;
mod rust;

use crate::context::Context;
use crate::module::Module;

pub fn handle(module: &str, context: &Context) -> Option<Module> {
    match module {
        "dir" | "directory" => directory::segment(context),
        "char" | "character" => character::segment(context),
        "node" | "nodejs" => nodejs::segment(context),
        "rust" | "rustlang" => rust::segment(context),
        "python" => python::segment(context),
        "go" | "golang" => go::segment(context),
        "line_break" => line_break::segment(context),
        "package" => package::segment(context),
        "git_branch" => git_branch::segment(context),

        _ => panic!("Unknown module: {}", module),
    }
}