Rename segements

This commit is contained in:
Matan Kushner 2019-04-04 20:35:35 -04:00
parent 168d568d54
commit 472b66894d
No known key found for this signature in database
GPG Key ID: 4B98C3A8949CA8A4
5 changed files with 6 additions and 7 deletions

View File

@ -1,6 +1,5 @@
#[macro_use]
extern crate clap;
extern crate rayon;
extern crate ansi_term;
extern crate dirs;

View File

@ -1,6 +1,6 @@
mod char;
mod dir;
mod line_sep;
mod directory;
mod line_break;
use clap::ArgMatches;
use ansi_term::Style;
@ -32,9 +32,9 @@ impl Default for Segment {
pub fn handle(module: &str, args: &ArgMatches) -> Segment {
match module {
"char" => char::segment(&args),
"dir" => dir::segment(&args),
"line_sep" => line_sep::segment(&args),
"char" | "character" => char::segment(&args),
"dir" | "directory" => directory::segment(&args),
"line_break" => line_break::segment(&args),
_ => panic!("Unknown module: {}", module),
}

View File

@ -3,7 +3,7 @@ use crate::modules::Segment;
use clap::ArgMatches;
pub fn prompt(args: ArgMatches) {
let default_prompt = vec!["dir", "line_sep", "char"];
let default_prompt = vec!["directory", "line_break", "character"];
default_prompt.into_iter()
.map(|module| modules::handle(module, &args))