X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/6352ebb0eb4cb83240c6d4998e0ef1375b041191..ce17f0a9b30a6a1b9eaf1b97ddbfc43355e5355a:/src/main.rs?ds=inline diff --git a/src/main.rs b/src/main.rs index a0a9fef..a5c2cf6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ mod metadata; mod post; mod template; mod utils; +mod remote; use std::iter::once; use std::env::args; @@ -17,6 +18,22 @@ use command::{available_commands, Command, help::Help}; use configuration::Configuration; fn main() -> Result<()> { + let result = run(); + + if cfg!(debug_assertions) { + result + } else { + match result { + Ok(_) => Ok(()), + Err(e) => { + eprintln!("Error: {}", e); + std::process::exit(1); + } + } + } +} + +fn run() -> Result<()> { let configuration = Configuration::new(); let commands = available_commands(); let arguments: Vec = args().collect();