1use clap::Parser;
4
5#[must_use]
7#[non_exhaustive]
8#[derive(Parser, Debug, Clone)]
9#[command(version, about = "DocSpec HTTP API server (markdown → BlockNote JSON)")]
10pub struct Args {
11 #[arg(long, default_value = "127.0.0.1")]
13 pub host: String,
14
15 #[arg(long, default_value_t = 3000)]
17 pub port: u16,
18}
19
20impl Args {
21 #[inline]
23 #[must_use]
24 pub fn into_config(self) -> crate::server::ServerConfig {
25 crate::server::ServerConfig::new(self.host, self.port)
26 }
27
28 #[inline]
30 pub fn new(host: String, port: u16) -> Self {
31 Self { host, port }
32 }
33}