fishctl/src/main.rs

31 lines
660 B
Rust
Raw Normal View History

2024-06-20 02:07:34 +09:00
mod command;
2024-06-20 05:08:33 +09:00
mod config;
2024-06-20 02:07:34 +09:00
2024-06-21 03:18:21 +09:00
use color_print::cprintln;
2024-06-21 03:23:37 +09:00
use std::process::ExitCode;
2024-06-20 02:07:34 +09:00
/// latest Firefish version as of this fishctl release
const FIREFISH_VERSION: &str = "20240613";
2024-06-20 03:19:20 +09:00
#[tokio::main]
2024-06-21 03:23:37 +09:00
async fn main() -> ExitCode {
2024-06-21 03:30:05 +09:00
let res = command::run().await;
2024-06-20 02:33:01 +09:00
2024-06-20 02:42:33 +09:00
if let Err(err) = res {
2024-06-21 03:18:21 +09:00
cprintln!("<r!><bold>Error:</></>");
2024-06-20 02:33:01 +09:00
println!(" raw: {:?}", err);
println!(" message: {}", err);
let mut err: &dyn std::error::Error = &err;
while let Some(src) = err.source() {
println!("caused by: {}", src);
err = src;
}
2024-06-21 03:23:37 +09:00
return ExitCode::FAILURE;
2024-06-20 02:33:01 +09:00
}
2024-06-21 03:23:37 +09:00
ExitCode::SUCCESS
2024-06-20 02:33:01 +09:00
}