Change repl behavior and instructions around quit

This commit is contained in:
Mostly Void 2022-08-24 17:34:01 +05:30
parent 462657def8
commit c5aa453071
No known key found for this signature in database
GPG key ID: E2B7342D0CAA82C2

View file

@ -42,7 +42,7 @@ pub const WELCOME_MESSAGE: &str = concatcp!(
END_COL,
"\n\n"
);
pub const INSTRUCTIONS: &str = "Enter an expression, or :help, or :exit/:q.\n";
pub const INSTRUCTIONS: &str = "Enter an expression, or :help, or :q to quit.\n";
pub const PROMPT: &str = concatcp!("\n", BLUE, "»", END_COL, " ");
pub const CONT_PROMPT: &str = concatcp!(BLUE, "", END_COL, " ");
@ -423,12 +423,9 @@ pub fn main() -> io::Result<()> {
}
}
":help" => {
println!("Use :exit or :q to exit.");
println!("Use :exit or :quit or :q to exit.");
}
":exit" => {
break;
}
":q" => {
":exit" | ":quit" | ":q" => {
break;
}
_ => {