A Transparent and Verifiable Way to Sync the AT Protocol's PLC Directory

colors in compare

+20 -4
+20 -4
cmd/plcbundle/compare.go
··· 190 190 fmt.Printf(" Local bundles: %d\n", c.LocalCount) 191 191 fmt.Printf(" Target bundles: %d\n", c.TargetCount) 192 192 fmt.Printf(" Common bundles: %d\n", c.CommonCount) 193 - fmt.Printf(" Missing bundles: %d\n", len(c.MissingBundles)) 194 - fmt.Printf(" Extra bundles: %d\n", len(c.ExtraBundles)) 195 - fmt.Printf(" Content mismatches: %d\n", len(c.HashMismatches)) 196 - fmt.Printf(" Chain mismatches: %d ⚠️\n", len(c.ChainMismatches)) 193 + fmt.Printf(" Missing bundles: %s\n", formatCount(len(c.MissingBundles))) 194 + fmt.Printf(" Extra bundles: %s\n", formatCount(len(c.ExtraBundles))) 195 + fmt.Printf(" Content mismatches: %s\n", formatCount(len(c.HashMismatches))) 196 + fmt.Printf(" Chain mismatches: %s\n", formatCountCritical(len(c.ChainMismatches))) 197 197 198 198 if c.LocalCount > 0 { 199 199 fmt.Printf("\n Local range: %06d - %06d\n", c.LocalRange[0], c.LocalRange[1]) ··· 330 330 fmt.Printf("This indicates different bundle content or chain integrity issues.\n") 331 331 } 332 332 } 333 + } 334 + 335 + // formatCount formats a count with color/symbol 336 + func formatCount(count int) string { 337 + if count == 0 { 338 + return "\033[32m0 ✓\033[0m" // Green with checkmark 339 + } 340 + return fmt.Sprintf("\033[33m%d ⚠️\033[0m", count) // Yellow with warning 341 + } 342 + 343 + // formatCountCritical formats a count for critical items (chain mismatches) 344 + func formatCountCritical(count int) string { 345 + if count == 0 { 346 + return "\033[32m0 ✓\033[0m" // Green with checkmark 347 + } 348 + return fmt.Sprintf("\033[31m%d ✗\033[0m", count) // Red with X 333 349 } 334 350 335 351 // filterContentOnlyMismatches returns content mismatches that don't have chain mismatches