diff options
| author | akbash <akbash@herdr.dev> | 2026-07-15 23:43:21 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-15 23:43:21 +0300 |
| commit | 600753b47b75898c311ecfb625bd1887031b3475 (patch) | |
| tree | f4e63d16c62d3efdf7d5a554a54398bc4f66f4d4 /src/main.rs | |
| parent | 7767f3ed6453ae573d7414d31cfe982f99a73782 (diff) | |
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 <ogulcancelik@gmail.com>
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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) |
