diff --git a/src/command/config/validate.rs b/src/command/config/validate.rs index c7d1edb..4cad82f 100644 --- a/src/command/config/validate.rs +++ b/src/command/config/validate.rs @@ -51,7 +51,7 @@ pub(super) fn run() -> Result<(), ValidationError> { cprintln!("Note: This is only a formal validation, so this does not guarantee that the settings are appropriate."); } - server_validation_result.and_then(|_| client_validation_result) + server_validation_result.and(client_validation_result) } fn read_server_toml() -> Result { diff --git a/src/main.rs b/src/main.rs index b7979ee..6e2292d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ mod config; use clap::{Parser, Subcommand}; use color_print::cprintln; +use std::process::ExitCode; /// latest Firefish version as of this fishctl release const FIREFISH_VERSION: &str = "20240613"; @@ -34,7 +35,7 @@ async fn run() -> Result<(), command::Error> { } #[tokio::main] -async fn main() { +async fn main() -> ExitCode { let res = run().await; if let Err(err) = res { @@ -49,6 +50,8 @@ async fn main() { err = src; } - std::process::exit(1); + return ExitCode::FAILURE; } + + ExitCode::SUCCESS }