diff options
author | Ivan Tham <[email protected]> | 2020-11-01 17:28:05 +0000 |
---|---|---|
committer | Ivan Tham <[email protected]> | 2020-11-01 17:28:05 +0000 |
commit | ea95516537b9ef2c9badd01abcf72f20066f9c55 (patch) | |
tree | 3c58c044b38618a808d53ca81654c0a36b32b7e5 /src/readline | |
parent | d31097959f29d7b82dabfd050eb988a896c2e44b (diff) |
Add help command
Close #41
Diffstat (limited to 'src/readline')
-rw-r--r-- | src/readline/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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; | |||
12 | 12 | ||
13 | use regex::Regex; | 13 | use regex::Regex; |
14 | 14 | ||
15 | use crate::error::CalcError; | ||
15 | use crate::eval_math_expression; | 16 | use crate::eval_math_expression; |
16 | 17 | ||
17 | pub struct RLHelper { | 18 | pub struct RLHelper { |
@@ -67,6 +68,7 @@ impl Highlighter for LineHighlighter { | |||
67 | } | 68 | } |
68 | Owned(coloured) | 69 | Owned(coloured) |
69 | } | 70 | } |
71 | Err(CalcError::Help) => Owned(line.replace("help", "\x1b[36mhelp\x1b[0m")), | ||
70 | Err(_) => Owned(format!("\x1b[31m{}\x1b[0m", line)), | 72 | Err(_) => Owned(format!("\x1b[31m{}\x1b[0m", line)), |
71 | } | 73 | } |
72 | } | 74 | } |