From c3abd54dc7ceb2c5033e00658e83698e875aea2c Mon Sep 17 00:00:00 2001 From: Michael Cross Date: Fri, 19 Feb 2016 21:11:41 +0000 Subject: [PATCH] CLI: Give helpful error message if --http/--tls is given without colon Fixes #134 --- cli_handlers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli_handlers.go b/cli_handlers.go index 06bdfbb0..fe4f7a80 100644 --- a/cli_handlers.go +++ b/cli_handlers.go @@ -44,10 +44,16 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) { } if c.GlobalIsSet("http") { + if strings.Index(c.GlobalString("http"), ":") == -1 { + logger().Fatalf("The --http switch only accepts interface:port or :port for its argument.") + } client.SetHTTPAddress(c.GlobalString("http")) } if c.GlobalIsSet("tls") { + if strings.Index(c.GlobalString("tls"), ":") == -1 { + logger().Fatalf("The --tls switch only accepts interface:port or :port for its argument.") + } client.SetTLSAddress(c.GlobalString("tls")) }