aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lego/b5d5eee2dd269f88f181d7a437be80194bfd0235.patch
blob: b039ebf0740bb2a7cb3cd24df7d1c48ef2c330d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
From b5d5eee2dd269f88f181d7a437be80194bfd0235 Mon Sep 17 00:00:00 2001
From: xenolf <xenolf@users.noreply.github.com>
Date: Thu, 12 May 2016 19:52:59 +0200
Subject: [PATCH] Update usage of codegangster/cli to remove deprecation
 warning. Fixes #206.

---
 cli.go          |  4 +++-
 cli_handlers.go | 14 ++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/cli.go b/cli.go
index 052fc76..10cd705 100644
--- a/cli.go
+++ b/cli.go
@@ -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
 }
diff --git a/cli_handlers.go b/cli_handlers.go
index 1601c43..5585bcf 100644
--- a/cli_handlers.go
+++ b/cli_handlers.go
@@ -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
 }