Fix --help, and required args

This commit is contained in:
Heikki Linnakangas
2023-04-26 15:18:19 +03:00
parent 45ca653d9c
commit 620efed7f6
2 changed files with 12 additions and 5 deletions

View File

@@ -1,3 +1,8 @@
/// A stand-alone program that routes connections, e.g. from
/// `aaa--bbb--123.external.domain` to `aaa.bbb.123.internal.domain`.
///
/// This allows connecting to pods/services running in the same Kubernetes cluster from
/// the outside. Similar to an ingress controller for HTTPS.
use std::{net::SocketAddr, sync::Arc};
use tokio::{net::TcpListener, io::AsyncWriteExt};
@@ -15,7 +20,6 @@ project_git_version!(GIT_VERSION);
fn cli() -> clap::Command {
clap::Command::new("Neon proxy/router")
.disable_help_flag(true)
.version(GIT_VERSION)
.arg(
Arg::new("listen")
@@ -28,19 +32,22 @@ fn cli() -> clap::Command {
Arg::new("tls-key")
.short('k')
.long("tls-key")
.help("path to TLS key for client postgres connections"),
.help("path to TLS key for client postgres connections")
.required(true),
)
.arg(
Arg::new("tls-cert")
.short('c')
.long("tls-cert")
.help("path to TLS cert for client postgres connections"),
.help("path to TLS cert for client postgres connections")
.required(true),
)
.arg(
Arg::new("dest")
.short('d')
.long("destination")
.help("append this domain zone to the SNI hostname to get the destination address"),
.help("append this domain zone to the SNI hostname to get the destination address")
.required(true),
)
}

View File

@@ -7,7 +7,7 @@ use anyhow::bail;
use clap::{self, Arg};
use proxy::config::{self, ProxyConfig};
use std::{borrow::Cow, net::SocketAddr};
use tokio::{net::TcpListener};
use tokio::net::TcpListener;
use tokio_util::sync::CancellationToken;
use tracing::info;
use utils::{project_git_version, sentry_init::init_sentry};