summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaz <ndpm13@ch-naseem.com>2025-07-31 15:53:19 +0100
committerNaz <ndpm13@ch-naseem.com>2025-07-31 15:53:19 +0100
commit030eef4c9b4f82fe16ddd019c436e7065758d3dc (patch)
tree728425d0ccba92d6e6a5b8aa8e11ad34d8a68fca
parent29c3640e5fea0f423357c28e3c221fcaca004ee8 (diff)
✨feat: use a separate run() function and handle error output in main
-rw-r--r--src/main.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index b6d538e..1ea31f8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,8 +4,7 @@ use clap::Parser;
use zap_rs::{AppImage, Cli, Command, PackageManager, Result, Source, SourceMetadata};
-#[tokio::main]
-async fn main() -> Result<()> {
+async fn run() -> Result<()> {
let args = Cli::parse();
let pm = PackageManager::new();
@@ -32,3 +31,10 @@ async fn main() -> Result<()> {
Ok(())
}
+
+#[tokio::main]
+async fn main() {
+ if let Err(e) = run().await {
+ eprintln!("Error: {e}");
+ }
+}