2019-03-08 18:47:06 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
// CODE GENERATED AUTOMATICALLY
|
|
|
|
// THIS FILE MUST NOT BE EDITED BY HAND
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2023-01-08 13:53:15 +00:00
|
|
|
"io"
|
2019-03-12 08:51:23 +00:00
|
|
|
"sort"
|
2019-03-08 18:47:06 +00:00
|
|
|
"strings"
|
|
|
|
"text/tabwriter"
|
|
|
|
)
|
|
|
|
|
|
|
|
func allDNSCodes() string {
|
2019-03-12 08:51:23 +00:00
|
|
|
providers := []string{
|
|
|
|
"manual",
|
2019-03-08 18:47:06 +00:00
|
|
|
{{- range $provider := .Providers }}
|
|
|
|
"{{ $provider.Code }}",
|
|
|
|
{{- end}}
|
2019-03-12 08:51:23 +00:00
|
|
|
}
|
|
|
|
sort.Strings(providers)
|
|
|
|
return strings.Join(providers, ", ")
|
2019-03-08 18:47:06 +00:00
|
|
|
}
|
|
|
|
|
2023-01-08 13:53:15 +00:00
|
|
|
func displayDNSHelp(w io.Writer, name string) error {
|
|
|
|
w = tabwriter.NewWriter(w, 0, 0, 2, ' ', 0)
|
2019-07-10 17:34:10 +00:00
|
|
|
ew := &errWriter{w: w}
|
|
|
|
|
2019-03-08 18:47:06 +00:00
|
|
|
switch name {
|
2019-10-24 23:27:40 +00:00
|
|
|
{{- range $provider := .Providers }}
|
2019-03-08 18:47:06 +00:00
|
|
|
case "{{ $provider.Code }}":
|
|
|
|
// generated from: {{ .GeneratedFrom }}
|
2019-07-10 17:34:10 +00:00
|
|
|
ew.writeln(`Configuration for {{ $provider.Name }}.`)
|
|
|
|
ew.writeln(`Code: '{{ $provider.Code }}'`)
|
|
|
|
ew.writeln(`Since: '{{ $provider.Since }}'`)
|
|
|
|
ew.writeln()
|
2019-03-08 18:47:06 +00:00
|
|
|
{{if $provider.Configuration }}{{if $provider.Configuration.Credentials }}
|
2019-07-10 17:34:10 +00:00
|
|
|
ew.writeln(`Credentials:`)
|
2019-03-08 18:47:06 +00:00
|
|
|
{{- range $k, $v := $provider.Configuration.Credentials }}
|
2019-07-10 17:34:10 +00:00
|
|
|
ew.writeln(` - "{{ $k }}": {{ safe $v }}`)
|
2019-03-08 18:47:06 +00:00
|
|
|
{{- end}}
|
2019-07-10 17:34:10 +00:00
|
|
|
ew.writeln()
|
2019-03-08 18:47:06 +00:00
|
|
|
{{end}}{{if $provider.Configuration.Additional }}
|
2019-07-10 17:34:10 +00:00
|
|
|
ew.writeln(`Additional Configuration:`)
|
2019-03-08 18:47:06 +00:00
|
|
|
{{- range $k, $v := $provider.Configuration.Additional }}
|
2019-07-10 17:34:10 +00:00
|
|
|
ew.writeln(` - "{{ $k }}": {{ safe $v }}`)
|
2019-03-08 18:47:06 +00:00
|
|
|
{{- end}}
|
|
|
|
{{end}}{{end}}
|
2019-07-10 17:34:10 +00:00
|
|
|
ew.writeln()
|
|
|
|
ew.writeln(`More information: https://go-acme.github.io/lego/dns/{{ $provider.Code }}`)
|
2019-03-08 18:47:06 +00:00
|
|
|
{{end}}
|
|
|
|
case "manual":
|
2019-07-10 17:34:10 +00:00
|
|
|
ew.writeln(`Solving the DNS-01 challenge using CLI prompt.`)
|
2019-03-08 18:47:06 +00:00
|
|
|
default:
|
2019-07-10 17:34:10 +00:00
|
|
|
return fmt.Errorf("%q is not yet supported", name)
|
2019-03-08 18:47:06 +00:00
|
|
|
}
|
2019-07-10 17:34:10 +00:00
|
|
|
|
2023-01-08 13:53:15 +00:00
|
|
|
if flusher, ok := w.(interface{ Flush() error }); ok {
|
|
|
|
return flusher.Flush()
|
2019-07-10 17:34:10 +00:00
|
|
|
}
|
2023-01-08 13:53:15 +00:00
|
|
|
return nil
|
|
|
|
}
|