Merge pull request #138 from xi2/improve-cli-error-messages

CLI: Give helpful error message if --http/--tls is given without colon
This commit is contained in:
xenolf 2016-02-20 01:43:04 +01:00
commit 9fef872cac

View file

@ -44,10 +44,16 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) {
} }
if c.GlobalIsSet("http") { 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")) client.SetHTTPAddress(c.GlobalString("http"))
} }
if c.GlobalIsSet("tls") { 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")) client.SetTLSAddress(c.GlobalString("tls"))
} }