From b7671b9a9749592313a8313e3d5d7f14628ade9a Mon Sep 17 00:00:00 2001 From: cheddar Date: Sun, 16 Feb 2025 13:57:24 -0500 Subject: [PATCH] Handle required parameter --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index dfb700d..7e38805 100644 --- a/main.go +++ b/main.go @@ -20,12 +20,17 @@ import ( func main() { useClient := flag.Bool("c", false, "Run client") - keyPath := flag.String("key", "", "Path to the private (client mode) or public (server mode) to use") + keyPath := flag.String("key", "", "Path to the private key (client mode) or public key (server mode) to use - Required") simulateCaddy := flag.Bool("caddy", false, "Simulate caddy reverse proxy") flag.Parse() + if *keyPath == "" { + flag.PrintDefaults() + return + } + if *useClient { runClient(keyPath, *simulateCaddy) } else {