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 continue // Do not emit noise when zone exists
} }
if !started { if !started {
out.StartDomain(zone.GetUniqueName()) out.StartDomain(zone)
started = true started = true
} }
skip := skipProvider(provider.Name, providersToProcess) 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. // Now we know what to do, print or do the tasks.
out.PrintfIf(fullMode, "PHASE 3: CORRECTIONS\n") out.PrintfIf(fullMode, "PHASE 3: CORRECTIONS\n")
for _, zone := range zonesToProcess { for _, zone := range zonesToProcess {
out.StartDomain(zone.GetUniqueName()) out.StartDomain(zone)
// Process DNS provider changes: // Process DNS provider changes:
providersToProcess := whichProvidersToProcess(zone.DNSProviderInstances, args.Providers) providersToProcess := whichProvidersToProcess(zone.DNSProviderInstances, args.Providers)

View file

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