summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index d1c0f02..a1e8c5b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -9,6 +9,8 @@ extern crate log;
use es_public_proxy::{filter_request, ProxyConfig};
+const CARGO_VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION");
+
async fn upstream_req(
req: Request<Body>,
config: ProxyConfig,
@@ -75,6 +77,10 @@ fn load_config() -> ProxyConfig {
println!("{}", usage());
std::process::exit(0);
}
+ [_, "--version"] => {
+ println!("es-public-proxy v{}", CARGO_VERSION.unwrap_or("UNKNOWN"));
+ std::process::exit(0);
+ }
[_, "--example-config"] => {
println!("{}", include_str!("../extra/example_config.toml"));
std::process::exit(0);