]> Untitled Git - bdk-cli/commitdiff
Fix repl error and help printing
authorSteve Myers <steve@notmandatory.org>
Tue, 29 Mar 2022 21:11:33 +0000 (14:11 -0700)
committerSteve Myers <steve@notmandatory.org>
Tue, 29 Mar 2022 21:11:33 +0000 (14:11 -0700)
src/bdk_cli.rs

index 736f9ae2b5e72dd6f158747db654b79626ea8d80..b094834c75ac48bc6519fb796a15b89e09b0f576 100644 (file)
@@ -374,8 +374,13 @@ fn handle_command(cli_opts: CliOpts, network: Network) -> Result<String, Error>
                                     .as_str())
                             })
                             .collect::<Result<Vec<_>, 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 {