X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/a9c6be4162bd15bd41ba3605127b56cb1eb32f32..898192d46a0012f77f07afba7145b96d734a707c:/src/main.rs?ds=sidebyside diff --git a/src/main.rs b/src/main.rs index 4cb8036..a5c2cf6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,14 @@ mod configuration; mod command; mod constants; +mod gemini_parser; +mod generator; +mod archiver; mod metadata; +mod post; +mod template; +mod utils; +mod remote; use std::iter::once; use std::env::args; @@ -11,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();