summaryrefslogtreecommitdiffstats
path: root/src/modules/mod.rs
blob: 869a82c2cbd4286bd19e8c88e4adf57e68610025 (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
29
30
mod char;

use clap::ArgMatches;
use ansi_term::Style;

pub struct Segment {
    pub style: Style,
    pub value: String,
    pub prefix: Option<Box<Segment>>,
    pub suffix: Option<Box<Segment>>,
}

impl Default for Segment {
    fn default() -> Segment {
        Segment {
            style: Style::default(),
            value: String::from(""),
            prefix: None,
            suffix: None
        }
    }
}

pub fn handle(module: &str, args: &ArgMatches) -> Segment {
    match module {
        "char" => char::segment(&args),

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