aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/server.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conrad.ludgate@truelayer.com>2022-04-21 10:12:56 +0100
committerGitHub <noreply@github.com>2022-04-21 09:12:56 +0000
commitd57f549855caf8ab90b5ea0ae7cc9445f3abedfc (patch)
tree0818ff405a3b697a0ca981d215ceb4dbb30cd15a /src/command/server.rs
parentFix SQL cache query (#318) (diff)
downloadatuin-d57f549855caf8ab90b5ea0ae7cc9445f3abedfc.zip
refactor commands for better separation (#313)
* refactor commands for better separation * fmt
Diffstat (limited to 'src/command/server.rs')
-rw-r--r--src/command/server.rs8
1 files changed, 6 insertions, 2 deletions
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