Skip to content

Commit 7356254

Browse files
committed
fix for go-acme#2283
1 parent 8686202 commit 7356254

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

cmd/accounts_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type AccountsStorage struct {
7070
// NewAccountsStorage Creates a new AccountsStorage.
7171
func NewAccountsStorage(ctx *cli.Context) *AccountsStorage {
7272
var userID string
73-
noEmail := ctx.IsSet("no-email")
73+
noEmail := ctx.IsSet(flgNoEmail)
7474
if noEmail {
7575
userID = "default"
7676
} else {

cmd/flags.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const (
1616
flgServer = "server"
1717
flgAcceptTOS = "accept-tos"
1818
flgEmail = "email"
19+
flgNoEmail = "no-email"
1920
flgCSR = "csr"
2021
flgEAB = "eab"
2122
flgKID = "kid"
@@ -73,7 +74,7 @@ func CreateFlags(defaultPath string) []cli.Flag {
7374
Usage: "Email used for registration and recovery contact.",
7475
},
7576
&cli.BoolFlag{
76-
Name: "no-email",
77+
Name: flgNoEmail,
7778
Aliases: []string{"M"},
7879
EnvVars: []string{"LEGO_NO_EMAIL"},
7980
Usage: "Create an ACME request without including an email address.",

cmd/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func getKeyType(ctx *cli.Context) certcrypto.KeyType {
8585
func getEmail(ctx *cli.Context) string {
8686
email := ctx.String(flgEmail)
8787
if email == "" {
88-
log.Fatalf("You have to pass an account (email address) to the program using --%s or -m", flgEmail)
88+
log.Fatalf("You have to pass an account (email address) to the program using --%s or -m, or use --%s or -M to disable including an email in the ACME request.", flgEmail, flgNoEmail)
8989
}
9090
return email
9191
}

0 commit comments

Comments
 (0)