2019-03-08 18:47:06 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
// CODE GENERATED AUTOMATICALLY
|
|
|
|
// THIS FILE MUST NOT BE EDITED BY HAND
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
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
|
|
|
}
|
|
|
|
|
2019-07-10 17:34:10 +00:00
|
|
|
func displayDNSHelp(name string) error {
|
2019-05-27 17:20:45 +00:00
|
|
|
w := tabwriter.NewWriter(os.Stdout, 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 {
|
|
|
|
{{ range $provider := .Providers }}
|
|
|
|
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
|
|
|
|
|
|
|
if ew.err != nil {
|
|
|
|
return fmt.Errorf("error: %v", ew.err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return w.Flush()
|
2019-03-08 18:47:06 +00:00
|
|
|
}
|