forked from Txio-labs/txio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.rs
More file actions
32 lines (26 loc) · 710 Bytes
/
Copy pathmain.rs
File metadata and controls
32 lines (26 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
mod cli;
mod chains;
mod config;
mod auth;
mod cache;
mod rpc;
mod utils;
use cli::{Cli, handlers::CommandHandler};
use clap::Parser;
use dotenvy::dotenv;
use colored::*;
#[tokio::main]
async fn main() {
// Load environment variables from .env file
dotenv().ok();
let cli = Cli::parse();
if let Err(e) = CommandHandler::handle(cli).await {
eprintln!("{} {}", "Error:".bold().red(), e);
// Suggest corrections for common mistakes if possible
let err_str = e.to_string();
if err_str.contains("Unknown chain") {
// strsim could be used here for fuzzy matching if we had more context
}
std::process::exit(1);
}
}