#![cfg_attr(nightly, feature(never_type))] #![cfg_attr(nightly, feature(associated_type_defaults))] #![allow(dead_code)] #[macro_use] extern crate log; #[macro_use] extern crate lazy_static; #[macro_use] extern crate lazy_format; #[macro_use] extern crate cfg_if; #[macro_use] extern crate ad_hoc_iter; #[allow(unused_imports)] use color_eyre::{ eyre::{ eyre, self, WrapErr as _, }, SectionExt as _, Help as _, }; mod ext; use ext::*; mod arg; #[inline] fn init() -> Result<(), eyre::Report> { color_eyre::install()?; pretty_env_logger::init(); trace!("installed panic handler & logger"); Ok(()) } async fn real_main() -> Result { init().wrap_err(eyre!("Failed to initialise logger / panic handler"))?; arg::print_usage(); Ok(0) } #[tokio::main] async fn main() -> Result<(), eyre::Report> { Ok(match real_main().await? { 0 => trace!("Exiting with normal code 0"), ex => { warn!("Exiting with nonzero exit code: {}", ex); std::process::exit(ex) }, }) }