You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
45 lines
1.5 KiB
use clap::{App, Arg};
|
|
|
|
use VERSION;
|
|
use DEFAULT_HOST;
|
|
use DEFAULT_PORT_STR;
|
|
use DEFAULT_WORKERS_STR;
|
|
|
|
pub mod parse;
|
|
|
|
pub fn get_app() -> App<'static, 'static> {
|
|
App::new("Dynamic DNS Server")
|
|
.author("Drew Short, <warrick@sothr.com>")
|
|
.version(VERSION)
|
|
.about("Receive DDNS requests and update associated cloudflare subdomains")
|
|
.args(&[
|
|
Arg::with_name("config")
|
|
.short("c")
|
|
.long("config")
|
|
.value_name("PATH")
|
|
.default_value("/etc/rsddns/rsddns.yml")
|
|
.help("Set a custom configuration file path.")
|
|
.takes_value(true),
|
|
Arg::with_name("host")
|
|
.short("h")
|
|
.long("host")
|
|
.value_name("HOST")
|
|
.default_value(&DEFAULT_HOST)
|
|
.help("The address the server listens on.")
|
|
.takes_value(true),
|
|
Arg::with_name("port")
|
|
.short("p")
|
|
.long("port")
|
|
.value_name("PORT")
|
|
.default_value(&DEFAULT_PORT_STR)
|
|
.help("The port to run the server on.")
|
|
.takes_value(true),
|
|
Arg::with_name("workers")
|
|
.short("w")
|
|
.long("workers")
|
|
.value_name("NUMBER")
|
|
.default_value(&DEFAULT_WORKERS_STR)
|
|
.help("The number of workers to serve requests with (Defaults to the number of cores on the system).")
|
|
.takes_value(true),
|
|
])
|
|
}
|