From 8dc0765f783f6544e0bc679b58a892e242e671e8 Mon Sep 17 00:00:00 2001 From: Caznix Date: Fri, 6 Dec 2024 10:56:18 -0500 Subject: [PATCH] change the look of autocompletion --- engine/src/core/repl/mod.rs | 3 +++ engine/src/core/repl/repl.rs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/src/core/repl/mod.rs b/engine/src/core/repl/mod.rs index 87776ec..85dce9a 100644 --- a/engine/src/core/repl/mod.rs +++ b/engine/src/core/repl/mod.rs @@ -3,6 +3,7 @@ pub mod repl; use std::{borrow::Borrow, collections::HashMap, sync::Arc}; +use colored::Colorize; use lazy_static::lazy_static; use log::{debug, info}; use parking_lot::RwLock; @@ -128,6 +129,8 @@ impl CommandList { } (_, _) => command.execute(args), } + } else { + eprintln!("Command: '{}' was not found", name.red().italic()); } } } diff --git a/engine/src/core/repl/repl.rs b/engine/src/core/repl/repl.rs index 0798286..ca5c598 100644 --- a/engine/src/core/repl/repl.rs +++ b/engine/src/core/repl/repl.rs @@ -37,7 +37,7 @@ impl Highlighter for MyHelper { } fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str> { - Owned(hint.bold().to_string()) + Owned(hint.italic().bright_black().to_string()) } } @@ -139,6 +139,7 @@ fn tokenize(command: &str) -> Vec { fn evaluate_command(input: &str) { if input.trim().is_empty() { + println!("Empty command, skipping. type 'help' for a list of commands."); return; }