From fd3f2b4c1188abb0a70946ec651bfb9c03220857 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Tue, 29 Mar 2022 14:11:33 -0700 Subject: [PATCH] Fix repl error and help printing --- src/bdk_cli.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bdk_cli.rs b/src/bdk_cli.rs index 736f9ae..b094834 100644 --- a/src/bdk_cli.rs +++ b/src/bdk_cli.rs @@ -374,8 +374,13 @@ fn handle_command(cli_opts: CliOpts, network: Network) -> Result .as_str()) }) .collect::, Error>>()?; - let repl_subcommand = ReplSubCommand::from_iter_safe(split_line) - .map_err(|e| Error::Generic(e.to_string()))?; + let repl_subcommand = ReplSubCommand::from_iter_safe(split_line); + if let Err(err) = repl_subcommand { + println!("{}", err.to_string()); + continue; + } + // if error will be printed above + let repl_subcommand = repl_subcommand.unwrap(); debug!("repl_subcommand = {:?}", repl_subcommand); let result = match repl_subcommand { -- 2.49.0