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