Update usage of codegangster/cli to remove deprecation warning.

Fixes #206.
This commit is contained in:
xenolf 2016-05-12 19:52:59 +02:00
parent 948483535f
commit b5d5eee2dd
2 changed files with 13 additions and 5 deletions

4
cli.go
View file

@ -144,7 +144,7 @@ func main() {
app.Run(os.Args)
}
func dnshelp(c *cli.Context) {
func dnshelp(c *cli.Context) error {
fmt.Printf(
`Credentials for DNS providers must be passed through environment variables.
@ -175,4 +175,6 @@ Here is an example bash command using the CloudFlare DNS provider:
fmt.Println(`
For a more detailed explanation of a DNS provider's credential variables,
please consult their online documentation.`)
return nil
}

View file

@ -196,7 +196,7 @@ func handleTOS(c *cli.Context, client *acme.Client, acc *Account) {
}
}
func run(c *cli.Context) {
func run(c *cli.Context) error {
conf, acc, client := setup(c)
if acc.Registration == nil {
reg, err := client.Register()
@ -245,9 +245,11 @@ func run(c *cli.Context) {
}
saveCertRes(cert, conf)
return nil
}
func revoke(c *cli.Context) {
func revoke(c *cli.Context) error {
conf, _, client := setup(c)
@ -269,9 +271,11 @@ func revoke(c *cli.Context) {
logger().Print("Certificate was revoked.")
}
}
return nil
}
func renew(c *cli.Context) {
func renew(c *cli.Context) error {
conf, _, client := setup(c)
if len(c.GlobalStringSlice("domains")) <= 0 {
@ -299,7 +303,7 @@ func renew(c *cli.Context) {
}
if int(expTime.Sub(time.Now()).Hours()/24.0) > c.Int("days") {
return
return nil
}
}
@ -330,4 +334,6 @@ func renew(c *cli.Context) {
}
saveCertRes(newCert, conf)
return nil
}