From d513ff811d7a9a8982470988494ae6833cefae1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Mon, 27 Feb 2023 17:34:35 +0100 Subject: [PATCH] Allow getting the crate version from the CLI --- src/bin/tcp2udp.rs | 6 +++++- src/bin/udp2tcp.rs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bin/tcp2udp.rs b/src/bin/tcp2udp.rs index 20cebf6..5ff1819 100644 --- a/src/bin/tcp2udp.rs +++ b/src/bin/tcp2udp.rs @@ -7,7 +7,11 @@ use std::num::NonZeroU8; use udp_over_tcp::{tcp2udp, NeverOkResult}; #[derive(Debug, Parser)] -#[command(name = "tcp2udp", about = "Listen for incoming TCP and forward to UDP")] +#[command( + name = "tcp2udp", + about = "Listen for incoming TCP and forward to UDP", + version +)] pub struct Options { /// Sets the number of worker threads to use. /// The default value is the number of cores available to the system. diff --git a/src/bin/udp2tcp.rs b/src/bin/udp2tcp.rs index ba5ca86..cdca9a6 100644 --- a/src/bin/udp2tcp.rs +++ b/src/bin/udp2tcp.rs @@ -7,7 +7,11 @@ use std::net::SocketAddr; use udp_over_tcp::udp2tcp; #[derive(Debug, Parser)] -#[command(name = "udp2tcp", about = "Listen for incoming UDP and forward to TCP")] +#[command( + name = "udp2tcp", + about = "Listen for incoming UDP and forward to TCP", + version +)] pub struct Options { /// The IP and UDP port to bind to and accept incoming connections on. #[arg(long = "udp-listen")]