about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/eval/src/main.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tvix/eval/src/main.rs b/tvix/eval/src/main.rs
index d70d82f68f8a..22bea16d0e20 100644
--- a/tvix/eval/src/main.rs
+++ b/tvix/eval/src/main.rs
@@ -8,6 +8,9 @@ struct Args {
     /// Path to a script to evaluate
     script: Option<PathBuf>,
 
+    #[clap(long, short = 'E')]
+    expr: Option<String>,
+
     #[clap(flatten)]
     eval_options: tvix_eval::Options,
 }
@@ -17,6 +20,10 @@ fn main() {
 
     if let Some(file) = args.script {
         run_file(file, args.eval_options)
+    } else if let Some(expr) = args.expr {
+        if let Ok(result) = tvix_eval::interpret(&expr, None, args.eval_options) {
+            println!("=> {} :: {}", result, result.type_of())
+        }
     } else {
         run_prompt(args.eval_options)
     }