|
|
@ -3,18 +3,24 @@ use std::path::PathBuf; |
|
|
|
#[derive(Clone)]
|
|
|
|
pub enum PromptStyle {
|
|
|
|
None,
|
|
|
|
SimpleDirectory,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl PromptStyle {
|
|
|
|
pub fn fmt_style(&self, path: PathBuf) -> String {
|
|
|
|
match self {
|
|
|
|
PromptStyle::None => self.fmt_none(path),
|
|
|
|
PromptStyle::SimpleDirectory => self.fmt_simple_directory(path),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn fmt_none(&self, _: PathBuf) -> String {
|
|
|
|
return "» ".to_string();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn fmt_simple_directory(&self, path: PathBuf) -> String {
|
|
|
|
return format!("{} » ", path.to_string_lossy());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Prompt {
|
|
|
|