From d57f549855caf8ab90b5ea0ae7cc9445f3abedfc Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Thu, 21 Apr 2022 10:12:56 +0100 Subject: refactor commands for better separation (#313) * refactor commands for better separation * fmt --- src/command/server.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/command/server.rs') diff --git a/src/command/server.rs b/src/command/server.rs index 9d97e928..cd05caca 100644 --- a/src/command/server.rs +++ b/src/command/server.rs @@ -1,5 +1,5 @@ use clap::Parser; -use eyre::Result; +use eyre::{Context, Result}; use atuin_server::launch; use atuin_server::settings::Settings; @@ -20,7 +20,11 @@ pub enum Cmd { } impl Cmd { - pub async fn run(&self, settings: Settings) -> Result<()> { + pub async fn run(self) -> Result<()> { + pretty_env_logger::init(); + + let settings = Settings::new().wrap_err("could not load server settings")?; + match self { Self::Start { host, port } => { let host = host -- cgit v1.3.1