summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhspetersson <jhspetersson@gmail.com>2023-12-26 20:34:27 +0100
committerjhspetersson <jhspetersson@gmail.com>2023-12-26 20:34:27 +0100
commit69b162eca206a1a41f5dee3a754bbd0513a4e73b (patch)
treedb5f48b5bc5fcf323d004e1216ad86752205e646
parentb8473ee97dc04ad293f3441c90423c6b2ab5d25a (diff)
add `quit` and `exit` commands for interactive mode
-rw-r--r--src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index b8d96e7..3ef1a9d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -133,6 +133,9 @@ fn main() -> ExitCode {
loop {
let readline = rl.readline("query> ");
match readline {
+ Ok(cmd) if cmd.to_ascii_lowercase().trim() == "quit" || cmd.to_ascii_lowercase().trim() == "exit" => {
+ break
+ },
Ok(query) => {
let _ = rl.add_history_entry(query.as_str());
exec_search(query, &mut config, no_color);