2019-04-05 01:35:24 +00:00
|
|
|
mod character;
|
2019-04-05 00:35:35 +00:00
|
|
|
mod directory;
|
|
|
|
mod line_break;
|
2019-04-10 13:22:11 +00:00
|
|
|
mod nodejs;
|
2019-04-04 00:14:26 +00:00
|
|
|
|
2019-04-12 21:49:20 +00:00
|
|
|
use crate::segment::Segment;
|
2019-04-05 01:35:24 +00:00
|
|
|
use clap::ArgMatches;
|
2019-04-16 00:54:52 +00:00
|
|
|
use std::path::Path;
|
2019-04-04 16:18:02 +00:00
|
|
|
|
2019-04-16 00:54:52 +00:00
|
|
|
pub fn handle(module: &str, current_dir: &Path, args: &ArgMatches) -> Option<Segment> {
|
2019-04-04 00:14:26 +00:00
|
|
|
match module {
|
2019-04-16 00:54:52 +00:00
|
|
|
"dir" | "directory" => directory::segment(current_dir, args),
|
|
|
|
"char" | "character" => character::segment(current_dir, args),
|
|
|
|
"node" | "nodejs" => nodejs::segment(current_dir, args),
|
|
|
|
"line_break" => line_break::segment(current_dir, args),
|
2019-04-04 00:14:26 +00:00
|
|
|
|
|
|
|
_ => panic!("Unknown module: {}", module),
|
|
|
|
}
|
|
|
|
}
|