]> git.r.bdr.sh - rbdr/blog/blobdiff - src/main.rs
Don't use clang
[rbdr/blog] / src / main.rs
index a0a9fefc61525c7b256161c64fba5693b9b17393..a5c2cf646a22b7e219d7c594c456e745044c73c9 100644 (file)
@@ -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<String> = args().collect();