1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-27 03:32:05 +02:00

Merge pull request #55 from gianluca311/cliFix

CLI: fix short domain args
This commit is contained in:
xenolf 2015-12-17 21:39:37 +01:00
commit 102a9f756b

View File

@ -27,7 +27,7 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) {
}
conf := NewConfiguration(c)
if !c.GlobalIsSet("email") {
if len(c.GlobalString("email")) == 0 {
logger().Fatal("You have to pass an account (email address) to the program using --email or -m")
}
@ -122,8 +122,8 @@ func run(c *cli.Context) {
}
}
if !c.GlobalIsSet("domains") {
logger().Fatal("Please specify --domains")
if len(c.GlobalStringSlice("domains")) == 0 {
logger().Fatal("Please specify --domains or -d")
}
cert, failures := client.ObtainSANCertificate(c.GlobalStringSlice("domains"), true)
@ -192,7 +192,7 @@ func renew(c *cli.Context) {
logger().Printf("Could not get Certification expiration for domain %s", domain)
}
if int(expTime.Sub(time.Now()).Hours() / 24.0) <= c.Int("days") {
if int(expTime.Sub(time.Now()).Hours()/24.0) <= c.Int("days") {
continue
}
}