From 692d7651ab265ad9be5bb059357e778b3c0b426c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Mota?= Date: Mon, 3 Oct 2022 13:38:27 +0100 Subject: [PATCH] Add tips to REPL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Mota --- crates/repl_cli/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/repl_cli/src/lib.rs b/crates/repl_cli/src/lib.rs index a31db78916..e131615755 100644 --- a/crates/repl_cli/src/lib.rs +++ b/crates/repl_cli/src/lib.rs @@ -45,6 +45,7 @@ pub const WELCOME_MESSAGE: &str = concatcp!( "\n\n" ); pub const INSTRUCTIONS: &str = "Enter an expression, or :help, or :q to quit.\n"; +pub const TIPS: &str = "Everything in the repl needs to be an expression, it needs to return something. See example below: \n\n\n foo = 1 \n\n foo"; pub const PROMPT: &str = concatcp!("\n", BLUE, "»", END_COL, " "); pub const CONT_PROMPT: &str = concatcp!(BLUE, "…", END_COL, " "); @@ -392,7 +393,7 @@ pub fn main() -> io::Result<()> { // To debug rustyline: // env_logger::init(); // RUST_LOG=rustyline=debug cargo run repl 2> debug.log - print!("{}{}", WELCOME_MESSAGE, INSTRUCTIONS); + print!("{}{}", WELCOME_MESSAGE, INSTRUCTIONS, TIPS); let mut prev_line_blank = false; let mut editor = Editor::::new();