Skip to content

Commit

Permalink
ssh remoting: Do not print error backtrace on non-zero exit (zed-indu…
Browse files Browse the repository at this point in the history
…stries#19290)

Closes #ISSUE


Release Notes:

- N/A
  • Loading branch information
mrnugget authored Oct 17, 2024
1 parent 57369b5 commit 3216de7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/remote_server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(target_os = "windows", allow(unused, dead_code))]

use anyhow::Result;
use clap::{Parser, Subcommand};
use std::path::PathBuf;

Expand Down Expand Up @@ -40,13 +39,13 @@ fn main() {
}

#[cfg(not(windows))]
fn main() -> Result<()> {
fn main() {
use remote::proxy::ProxyLaunchError;
use remote_server::unix::{execute_proxy, execute_run};

let cli = Cli::parse();

match cli.command {
let result = match cli.command {
Some(Commands::Run {
log_file,
pid_file,
Expand Down Expand Up @@ -74,11 +73,15 @@ fn main() -> Result<()> {
},
Some(Commands::Version) => {
eprintln!("{}", env!("ZED_PKG_VERSION"));
Ok(())
std::process::exit(0);
}
None => {
eprintln!("usage: remote <run|proxy|version>");
std::process::exit(1);
}
};
if let Err(error) = result {
log::error!("exiting due to error: {}", error);
std::process::exit(1);
}
}

0 comments on commit 3216de7

Please sign in to comment.