diff --git a/dozer-orchestrator/src/cli/repl/editor.rs b/dozer-orchestrator/src/cli/repl/editor.rs index e3ef1e4e1b..44d130abae 100644 --- a/dozer-orchestrator/src/cli/repl/editor.rs +++ b/dozer-orchestrator/src/cli/repl/editor.rs @@ -63,26 +63,26 @@ fn execute( running: Arc, ) -> Result { let cmd_map = get_commands(); - let (_, dozer_cmd) = cmd_map - .iter() - .find(|(s, _)| s.to_string() == *cmd) - .map_or(Err(CliError::UnknownCommand(cmd.to_string())), Ok)?; - - match dozer_cmd { - DozerCmd::Help => { - print_help(); - Ok(true) - } - DozerCmd::ShowSources => { - list_sources(config_path)?; - Ok(true) - } - DozerCmd::Sql => { - super::sql::editor(config_path, running)?; - Ok(true) + if let Some((_, dozer_cmd)) = cmd_map.iter().find(|(s, _)| s.to_string() == *cmd) { + match dozer_cmd { + DozerCmd::Help => { + print_help(); + Ok(true) + } + DozerCmd::ShowSources => { + list_sources(config_path)?; + Ok(true) + } + DozerCmd::Sql => { + super::sql::editor(config_path, running)?; + Ok(true) + } + DozerCmd::Exit => Ok(false), + DozerCmd::TestConnections => todo!(), } - DozerCmd::Exit => Ok(false), - DozerCmd::TestConnections => todo!(), + } else { + error!("Unknown command: {}", cmd); + Ok(true) } }