commit 467a2c2135d456935a37e3b8e1c35bf56d4b93c6
parent 3f22276c5ba5b1d08485fec0e7a3de4bfe54572f
Author: Juan F. Meleiro <juan@juanmeleiro.mat.br>
Date: Fri, 1 Dec 2023 13:27:09 -0300
Sort monthly report alphabetically
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/report.lua b/lib/report.lua
@@ -69,8 +69,15 @@ function _M.monthly(args, players, log)
CHANGES = string.format("include(%s)", fns.changes)
}
+ local names = {}
+ for n,_ in pairs(players) do
+ table.insert(names, n)
+ end
+ table.sort(names)
+
local hist = io.open(fns.history, "w")
- for n,h in pairs(players) do
+ for i,n in ipairs(names) do
+ local h = players[n]
hist:write("===============\n"..n.."\n")
for _,e in ipairs(h) do
if e.reason == "s" then