Again
This commit is contained in:
16
main.go
16
main.go
@@ -4,6 +4,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -214,8 +215,19 @@ func main() {
|
|||||||
stats.TotalModifications, stats.ProcessedFiles, stats.ProcessedFiles+stats.FailedFiles)
|
stats.TotalModifications, stats.ProcessedFiles, stats.ProcessedFiles+stats.FailedFiles)
|
||||||
fmt.Printf("Operation complete! Modified %d values in %d/%d files\n",
|
fmt.Printf("Operation complete! Modified %d values in %d/%d files\n",
|
||||||
stats.TotalModifications, stats.ProcessedFiles, stats.ProcessedFiles+stats.FailedFiles)
|
stats.TotalModifications, stats.ProcessedFiles, stats.ProcessedFiles+stats.FailedFiles)
|
||||||
for command, count := range stats.ModificationsPerCommand {
|
sortedCommands := make([]string, 0, len(stats.ModificationsPerCommand))
|
||||||
logger.Info("Command %q made %d modifications", command, count)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user