Skip to content
Snippets Groups Projects
Commit 2dd5cf8c authored by Jason Volk's avatar Jason Volk Committed by 🥺
Browse files

move clap; fix version


Signed-off-by: default avatarJason Volk <jason@zemos.net>
parent 74832bdc
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
use crate::{Error, Result}; use crate::{Error, Result};
pub mod clap;
pub mod content_disposition; pub mod content_disposition;
pub mod defer; pub mod defer;
......
...@@ -2,19 +2,18 @@ ...@@ -2,19 +2,18 @@
use std::path::PathBuf; use std::path::PathBuf;
pub use clap::Parser; use clap::Parser;
use conduit_core::utils::conduwuit_version;
use super::conduwuit_version;
/// Commandline arguments /// Commandline arguments
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
#[clap(version = conduwuit_version(), about, long_about = None)] #[clap(version = conduwuit_version(), about, long_about = None)]
pub struct Args { pub(crate) struct Args {
#[arg(short, long)] #[arg(short, long)]
/// Optional argument to the path of a conduwuit config TOML file /// Optional argument to the path of a conduwuit config TOML file
pub config: Option<PathBuf>, pub(crate) config: Option<PathBuf>,
} }
/// Parse commandline arguments into structured data /// Parse commandline arguments into structured data
#[must_use] #[must_use]
pub fn parse() -> Args { Args::parse() } pub(crate) fn parse() -> Args { Args::parse() }
pub(crate) mod clap;
mod mods; mod mods;
mod server; mod server;
...@@ -5,7 +6,7 @@ ...@@ -5,7 +6,7 @@
use std::{cmp, sync::Arc, time::Duration}; use std::{cmp, sync::Arc, time::Duration};
use conduit::{debug_info, error, utils::clap, Error, Result}; use conduit::{debug_info, error, Error, Result};
use server::Server; use server::Server;
use tokio::runtime; use tokio::runtime;
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
config::Config, config::Config,
info, info,
log::{LogLevelReloadHandles, ReloadHandle}, log::{LogLevelReloadHandles, ReloadHandle},
utils::{clap, maximize_fd_limit}, utils::maximize_fd_limit,
Error, Result, Error, Result,
}; };
use tokio::runtime; use tokio::runtime;
use tracing_subscriber::{prelude::*, reload, EnvFilter, Registry}; use tracing_subscriber::{prelude::*, reload, EnvFilter, Registry};
use crate::clap::Args;
/// Server runtime state; complete /// Server runtime state; complete
pub(crate) struct Server { pub(crate) struct Server {
/// Server runtime state; public portion /// Server runtime state; public portion
...@@ -27,7 +29,7 @@ pub(crate) struct Server { ...@@ -27,7 +29,7 @@ pub(crate) struct Server {
} }
impl Server { impl Server {
pub(crate) fn build(args: clap::Args, runtime: Option<&runtime::Handle>) -> Result<Arc<Server>, Error> { pub(crate) fn build(args: Args, runtime: Option<&runtime::Handle>) -> Result<Arc<Server>, Error> {
let config = Config::new(args.config)?; let config = Config::new(args.config)?;
#[cfg(feature = "sentry_telemetry")] #[cfg(feature = "sentry_telemetry")]
let sentry_guard = init_sentry(&config); let sentry_guard = init_sentry(&config);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment