feat(controller): use env in clap to allow env var config
Some checks failed
ci/woodpecker/push/ci Pipeline failed

This commit is contained in:
Daniel Lundin 2025-01-08 16:41:32 +01:00
parent a9a4c513f5
commit 7333ced376
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI
2 changed files with 4 additions and 3 deletions

View file

@ -27,6 +27,7 @@ anyhow = "1.0.95"
clap = { version = "4.5.23", features = [
"derive",
"deprecated",
"env",
"wrap_help",
"string",
] }

View file

@ -18,7 +18,7 @@ struct Cli {
#[arg(
long = "telemetry-otlp-endpoint",
default_value = "http://localhost:4317",
value_name = "OTEL_EXPORTER_OTLP_ENDPOINT"
env = "OTEL_EXPORTER_OTLP_ENDPOINT",
)]
otlp_endpoint: Option<String>,
@ -26,14 +26,14 @@ struct Cli {
long = "log-stderr",
short = 'v',
default_value = "false",
value_name = "LOG_TO_STDERR"
env = "LOG_TO_STDERR"
)]
log_stderr: bool,
#[arg(
long = "listen-address",
default_value = "0.0.0.0:9474",
value_name = "LISTEN_ADDRESS"
env = "LISTEN_ADDRESS"
)]
listen_address: String,
}