diff --git a/tools/repl/src/repl.rs b/tools/repl/src/repl.rs index 6638c120..20f20f72 100644 --- a/tools/repl/src/repl.rs +++ b/tools/repl/src/repl.rs @@ -128,11 +128,20 @@ impl REPL { println!("{}", result_msg); } - fn call_module<'args>(&mut self, mut args: impl Iterator) { + fn call_module<'args>(&mut self, args: impl Iterator) { use itertools::Itertools; + let mut args = args.peekable(); next_argument!(module_name, args, "Module name should be specified"); next_argument!(func_name, args, "Function name should be specified"); + let show_result_arg = match args.peek() { + Some(option) if *option == "-nr" => { + args.next(); + false + } + Some(_) => true, + None => true, + }; let module_arg: String = args.join(" "); let module_arg: serde_json::Value = match serde_json::from_str(&module_arg) { @@ -150,10 +159,14 @@ impl REPL { .app_service .call_module(module_name, func_name, module_arg, <_>::default()) { - Ok(result) => { + Ok(result) if show_result_arg => { let elapsed_time = start.elapsed(); format!("result: {:?}\n elapsed time: {:?}", result, elapsed_time) } + Ok(_) => { + let elapsed_time = start.elapsed(); + format!("call succeeded, elapsed time: {:?}", elapsed_time) + } Err(e) => format!("call failed with: {}", e), };