diff options
| author | Naz <ndpm13@ch-naseem.com> | 2025-08-03 10:08:45 +0100 |
|---|---|---|
| committer | Naz <ndpm13@ch-naseem.com> | 2025-08-03 10:08:45 +0100 |
| commit | 57ffe6ff51a8f3ccc41607f18dcf3c9039e85d94 (patch) | |
| tree | 7ab8e10bf2fce88ca3cdfb2a6b13c0717c638407 /src/main.rs | |
| parent | 6b3f5d37fbce2e880a454e66d8fbd78269f1c867 (diff) | |
| parent | dc0ee6ce99a0480b7a6c228492936b16ceaf60cd (diff) | |
Merge pull request 'Add comprehensive error types' (#12) from feat/issue-5 into main
Reviewed-on: https://git.ch-naseem.com/ndpm13/zap-rs/pulls/12
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 1d9505b..7840fae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,10 +2,9 @@ use std::path::PathBuf; use clap::Parser; -use zap_rs::{AppImage, Cli, Command, PackageManager, Source, SourceMetadata}; +use zap_rs::{AppImage, Cli, Command, PackageManager, Result, Source, SourceMetadata}; -#[tokio::main] -async fn main() -> Result<(), Box<dyn std::error::Error>> { +async fn run() -> Result<()> { let args = Cli::parse(); let pm = PackageManager::new(); @@ -32,3 +31,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { Ok(()) } + +#[tokio::main] +async fn main() { + if let Err(e) = run().await { + eprintln!("Error: {e}"); + std::process::exit(1); + } +} |
