From 9703d984bbd1c797da97260d3c4297b0fe9b9df2 Mon Sep 17 00:00:00 2001 From: lemonsh Date: Sat, 20 May 2023 17:16:35 +0200 Subject: [PATCH] fix wylew --- connectbox-shell/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connectbox-shell/src/main.rs b/connectbox-shell/src/main.rs index 2524ac7..37041a9 100644 --- a/connectbox-shell/src/main.rs +++ b/connectbox-shell/src/main.rs @@ -48,15 +48,15 @@ async fn main() -> Result<()> { if line.chars().all(char::is_whitespace) { continue; } - let cmd = match shell_cmd.try_get_matches_from_mut(QuotableArgs::new(&line)) { + let matches = shell_cmd.try_get_matches_from_mut(QuotableArgs::new(&line)); + rl.add_history_entry(line)?; + let cmd = match matches { Ok(mut matches) => ShellCommand::from_arg_matches_mut(&mut matches)?, Err(e) => { - rl.add_history_entry(line)?; e.print()?; continue; } }; - rl.add_history_entry(line)?; match cmd { ShellCommand::Exit => break, ShellCommand::PortForwards { cmd } => commands::pfw::run(cmd, &state).await?,