Drew Short
6 years ago
3 changed files with 50 additions and 41 deletions
@ -0,0 +1,45 @@ |
|||
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")
|
|||
.version(VERSION)
|
|||
.author("Drew Short <warrick@sothr.com>")
|
|||
.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.")
|
|||
.takes_value(true),
|
|||
])
|
|||
}
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue