about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/cli/src/repl.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/cli/src/repl.rs b/tvix/cli/src/repl.rs
index 7d29ae3d2c83..50c1779b0b68 100644
--- a/tvix/cli/src/repl.rs
+++ b/tvix/cli/src/repl.rs
@@ -18,12 +18,15 @@ fn state_dir() -> Option<PathBuf> {
 pub enum ReplCommand<'a> {
     Expr(&'a str),
     Explain(&'a str),
+    Quit,
 }
 
 impl<'a> ReplCommand<'a> {
     pub fn parse(input: &'a str) -> Self {
         if let Some(without_prefix) = input.strip_prefix(":d ") {
             Self::Explain(without_prefix)
+        } else if input.trim_end() == ":q" {
+            Self::Quit
         } else {
             Self::Expr(input)
         }
@@ -87,6 +90,7 @@ impl Repl {
                     };
 
                     let res = match ReplCommand::parse(input) {
+                        ReplCommand::Quit => break,
                         ReplCommand::Expr(input) => interpret(
                             Rc::clone(&io_handle),
                             input,