From 600753b47b75898c311ecfb625bd1887031b3475 Mon Sep 17 00:00:00 2001 From: akbash Date: Wed, 15 Jul 2026 23:43:21 +0300 Subject: fix: guard cli requests against protocol mismatches (#1453) refs #1435 Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com> Co-authored-by: Can Celik --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 1e44b058..0649da9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -473,8 +473,11 @@ fn main() -> io::Result<()> { std::process::exit(2); } - if let cli::CommandOutcome::Handled(code) = cli::maybe_run(&args)? { - std::process::exit(code); + match cli::maybe_run(&args) { + Ok(cli::CommandOutcome::Handled(code)) => std::process::exit(code), + Ok(cli::CommandOutcome::NotCli) => {} + Err(err) if cli::protocol_mismatch_was_reported(&err) => std::process::exit(1), + Err(err) => return Err(err), } // Subcommands and flags (no TUI, no logging needed) -- cgit v1.2.3