Replace argh with clap

Mostly for the more concise Config parsing and error handling.
This commit is contained in:
2023-06-27 14:03:52 -04:00
parent abd540d2ff
commit 7e06d23bba
6 changed files with 153 additions and 87 deletions

View File

@@ -6,6 +6,7 @@ use axum::{
Router,
};
use bytes::Bytes;
use clap::Parser;
use dotenvy::dotenv;
use notify::Watcher;
use sqlx::postgres::PgPoolOptions;
@@ -32,7 +33,7 @@ async fn serve(app: Router, addr: SocketAddr) -> Result<()> {
async fn main() -> Result<()> {
dotenv().ok();
let config = Config::new()?;
let config = Config::parse();
let (log_sender, log_receiver) = channel::<Bytes>(Bytes::new());
let _guards = init_tracing(&config, log_sender)?;