From 513773f641ae8edf4a18acf3d993bb094cfddd4e Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 28 Mar 2025 01:26:26 +0100 Subject: [PATCH] Again --- main.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 88309b9..0342ec6 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" "os" + "sort" "sync" "time" @@ -214,8 +215,19 @@ func main() { stats.TotalModifications, stats.ProcessedFiles, stats.ProcessedFiles+stats.FailedFiles) fmt.Printf("Operation complete! Modified %d values in %d/%d files\n", stats.TotalModifications, stats.ProcessedFiles, stats.ProcessedFiles+stats.FailedFiles) - for command, count := range stats.ModificationsPerCommand { - logger.Info("Command %q made %d modifications", command, count) + sortedCommands := make([]string, 0, len(stats.ModificationsPerCommand)) + for command := range stats.ModificationsPerCommand { + sortedCommands = append(sortedCommands, command) + } + sort.Strings(sortedCommands) + + for _, command := range sortedCommands { + count := stats.ModificationsPerCommand[command] + if count > 0 { + logger.Info("\tCommand %q made %d modifications", command, count) + } else { + logger.Warning("\tCommand %q made no modifications", command) + } } } }