X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli/blobdiff_plain/44e7b4de4073e6dc25681bb2fa6977bf5869689a..e91dea6e25c7c8c3c3b77ac7aab0bea97e589a07:/src/main.rs?ds=sidebyside diff --git a/src/main.rs b/src/main.rs index a611926..d3b3334 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,6 +46,22 @@ pub struct Track { #[tokio::main] async fn main() -> Result<()> { + let result = run().await; + + if cfg!(debug_assertions) { + result + } else { + match result { + Ok(_) => Ok(()), + Err(e) => { + eprintln!("Error: {}", e); + std::process::exit(1); + } + } + } +} + +async fn run() -> Result<()> { let mut configuration = Configuration::new(); let arguments = Arguments::parse();