diff --git a/tvix/eval/src/main.rs b/tvix/eval/src/main.rs index d70d82f68..22bea16d0 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, + #[clap(long, short = 'E')] + expr: Option, + #[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) }