From 344a6f6415c3c1b593677adec3b8844e0839971b Mon Sep 17 00:00:00 2001 From: s Date: Thu, 13 Nov 2025 14:43:15 -0500 Subject: created pretty printing for all commands --- internal/formatter/bssid.go | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 internal/formatter/bssid.go (limited to 'internal/formatter/bssid.go') diff --git a/internal/formatter/bssid.go b/internal/formatter/bssid.go new file mode 100644 index 0000000..06aa3cc --- /dev/null +++ b/internal/formatter/bssid.go @@ -0,0 +1,47 @@ +package formatter + +import ( + "fmt" + + "git.db.org.ai/dborg/internal/models" + "git.db.org.ai/dborg/internal/utils" +) + +func FormatBSSIDResults(response models.BSSIDLookupResponse, asJSON bool) error { + if asJSON { + return utils.PrintJSON(response) + } + + if len(response) == 0 { + PrintWarning("No results found") + return nil + } + + PrintSection("BSSID Lookup Results") + + for i, result := range response { + if i > 0 { + PrintDivider() + } + + fmt.Printf("\n%s: %s\n", Cyan("BSSID"), Bold(result.BSSID)) + + if result.Location != nil { + fmt.Printf("%s: %s\n", Cyan("Latitude"), Yellow(fmt.Sprintf("%.6f", result.Location.Latitude))) + fmt.Printf("%s: %s\n", Cyan("Longitude"), Yellow(fmt.Sprintf("%.6f", result.Location.Longitude))) + fmt.Printf("%s: %s\n", Cyan("Accuracy"), Dim(fmt.Sprintf("%d meters", result.Location.Accuracy))) + + if result.GoogleMap != "" { + fmt.Printf("%s: %s\n", Cyan("Google Maps"), result.GoogleMap) + } + if result.OpenStreetMap != "" { + fmt.Printf("%s: %s\n", Cyan("OpenStreetMap"), result.OpenStreetMap) + } + } else { + fmt.Printf("%s\n", Gray("No location data available")) + } + } + + fmt.Println() + return nil +} -- cgit v1.2.3