diff options
Diffstat (limited to 'cmd/dns.go')
| -rw-r--r-- | cmd/dns.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -6,6 +6,7 @@ import ( "git.db.org.ai/dborg/internal/client" "git.db.org.ai/dborg/internal/config" + "git.db.org.ai/dborg/internal/formatter" "git.db.org.ai/dborg/internal/models" "github.com/spf13/cobra" ) @@ -42,7 +43,16 @@ func runDNSTLDCheck(cmd *cobra.Command, args []string) error { fmt.Printf("Checking TLDs for term: %s\n\n", term) err = c.CheckDNSTLDStream(params, func(result json.RawMessage) error { - fmt.Println(string(result)) + var domainResult models.DomainResult + if err := json.Unmarshal(result, &domainResult); err != nil { + return fmt.Errorf("failed to parse result: %w", err) + } + + output, err := formatter.FormatDNSResults(&domainResult, IsJSONOutput()) + if err != nil { + return err + } + fmt.Print(output) return nil }) |
