WDYT about printing the domain using unicode again?

This commit is contained in:
Thomas Limoncelli 2025-11-25 12:02:16 -05:00
parent 53bfdd3615
commit efab6aaab1
No known key found for this signature in database
2 changed files with 9 additions and 5 deletions

View file

@ -289,7 +289,7 @@ func prun(args PPreviewArgs, push bool, interactive bool, out printer.CLI, repor
continue // Do not emit noise when zone exists
}
if !started {
out.StartDomain(zone.GetUniqueName())
out.StartDomain(zone)
started = true
}
skip := skipProvider(provider.Name, providersToProcess)
@ -352,7 +352,7 @@ func prun(args PPreviewArgs, push bool, interactive bool, out printer.CLI, repor
// Now we know what to do, print or do the tasks.
out.PrintfIf(fullMode, "PHASE 3: CORRECTIONS\n")
for _, zone := range zonesToProcess {
out.StartDomain(zone.GetUniqueName())
out.StartDomain(zone)
// Process DNS provider changes:
providersToProcess := whichProvidersToProcess(zone.DNSProviderInstances, args.Providers)

View file

@ -13,7 +13,7 @@ import (
// CLI is an abstraction around the CLI.
type CLI interface {
Printer
StartDomain(domain string)
StartDomain(dc *models.DomainConfig)
StartDNSProvider(name string, skip bool)
EndProvider(name string, numCorrections int, err error)
EndProvider2(name string, numCorrections int)
@ -89,8 +89,12 @@ type ConsolePrinter struct {
}
// StartDomain is called at the start of each domain.
func (c ConsolePrinter) StartDomain(domain string) {
fmt.Fprintf(c.Writer, "******************** Domain: %s\n", domain)
func (c ConsolePrinter) StartDomain(dc *models.DomainConfig) {
if dc.Name == dc.NameUnicode {
fmt.Fprintf(c.Writer, "******************** Domain: %s\n", dc.Name)
} else {
fmt.Fprintf(c.Writer, "******************** Domain: %s (%s)\n", dc.NameUnicode, dc.Name)
}
}
// PrintCorrection is called to print/format each correction.