summaryrefslogtreecommitdiffstats
path: root/src/modules/mod.rs
blob: 8e034331b8d1dd2c1523ea1f1a4c782631beea6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
mod character;
mod directory;
mod line_break;
mod nodejs;
mod python;
mod rust;

use crate::context::Context;
use crate::segment::Segment;

pub fn handle(module: &str, context: &Context) -> Option<Segment> {
    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),
        "line_break" => line_break::segment(context),

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