From 15fdb2a19ee2a038f7e72523c6a0b0c3cdc6c3e4 Mon Sep 17 00:00:00 2001 From: grandizzy <38490174+grandizzy@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:40:55 +0300 Subject: [PATCH] feat(chisel): add eval command (#9086) --- crates/chisel/bin/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/chisel/bin/main.rs b/crates/chisel/bin/main.rs index ba4d7e9bc336..70425279484a 100644 --- a/crates/chisel/bin/main.rs +++ b/crates/chisel/bin/main.rs @@ -92,6 +92,12 @@ pub enum ChiselSubcommand { /// Clear all cached chisel sessions from the cache directory ClearCache, + + /// Simple evaluation of a command without entering the REPL + Eval { + /// The command to be evaluated. + command: String, + }, } fn main() -> eyre::Result<()> { @@ -168,6 +174,10 @@ async fn main_args(args: Chisel) -> eyre::Result<()> { } return Ok(()) } + Some(ChiselSubcommand::Eval { command }) => { + dispatch_repl_line(&mut dispatcher, command).await; + return Ok(()) + } None => { /* No chisel subcommand present; Continue */ } }