eyre work

This commit is contained in:
John Smith
2022-07-06 23:15:51 -04:00
parent 2f05611170
commit cd0cd78e30
21 changed files with 345 additions and 229 deletions

View File

@@ -14,6 +14,8 @@ mod veilid_logs;
mod windows;
use cfg_if::*;
#[allow(unused_imports)]
use color_eyre::eyre::{bail, ensure, eyre, Result as EyreResult, WrapErr};
use server::*;
use tools::*;
use tracing::*;
@@ -25,16 +27,17 @@ pub mod veilid_client_capnp {
}
#[instrument(err)]
fn main() -> Result<(), String> {
fn main() -> EyreResult<()> {
#[cfg(windows)]
let _ = ansi_term::enable_ansi_support();
color_eyre::install()?;
let (settings, matches) = cmdline::process_command_line()?;
// --- Dump Config ---
if matches.occurrences_of("dump-config") != 0 {
return serde_yaml::to_writer(std::io::stdout(), &*settings.read())
.map_err(|e| e.to_string());
.wrap_err("failed to write yaml");
}
// --- Generate DHT Key ---