|
|
@ -2,7 +2,7 @@ use std::env; |
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub enum PromptStyle {
|
|
|
|
None,
|
|
|
|
Default,
|
|
|
|
SimpleDirectory,
|
|
|
|
BashLike,
|
|
|
|
}
|
|
|
@ -10,13 +10,13 @@ pub enum PromptStyle { |
|
|
|
impl PromptStyle {
|
|
|
|
pub fn fmt_style(&self) -> String {
|
|
|
|
match self {
|
|
|
|
PromptStyle::None => self.fmt_none(),
|
|
|
|
PromptStyle::Default => self.fmt_default(),
|
|
|
|
PromptStyle::SimpleDirectory => self.fmt_simple_directory(),
|
|
|
|
PromptStyle::BashLike => self.fmt_bash_like(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn fmt_none(&self) -> String {
|
|
|
|
fn fmt_default(&self) -> String {
|
|
|
|
"» ".to_string()
|
|
|
|
}
|
|
|
|
|
|
|
@ -54,7 +54,7 @@ pub struct Prompt { |
|
|
|
impl Prompt {
|
|
|
|
pub fn new() -> Self {
|
|
|
|
Self {
|
|
|
|
style: PromptStyle::None,
|
|
|
|
style: PromptStyle::Default,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|