From ea95516537b9ef2c9badd01abcf72f20066f9c55 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Mon, 2 Nov 2020 01:28:05 +0800 Subject: Add help command Close #41 --- src/readline/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/readline') diff --git a/src/readline/mod.rs b/src/readline/mod.rs index ea195ee..d689f95 100644 --- a/src/readline/mod.rs +++ b/src/readline/mod.rs @@ -12,6 +12,7 @@ use directories::ProjectDirs; use regex::Regex; +use crate::error::CalcError; use crate::eval_math_expression; pub struct RLHelper { @@ -67,6 +68,7 @@ impl Highlighter for LineHighlighter { } Owned(coloured) } + Err(CalcError::Help) => Owned(line.replace("help", "\x1b[36mhelp\x1b[0m")), Err(_) => Owned(format!("\x1b[31m{}\x1b[0m", line)), } } -- cgit v1.2.3