aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-07-10 03:13:27 +0200
committerKim Alvefur <zash@zash.se>2020-07-10 03:13:27 +0200
commit63b691caec0d4df348d1b884d745a22b17b5d72a (patch)
treed511dce162967c2b5407ed2e3dab7fef0f996952
parent27ad6f88c55f968b551e31e7c3051a29c58a75fc (diff)
downloadprosody-63b691caec0d4df348d1b884d745a22b17b5d72a.tar.gz
prosody-63b691caec0d4df348d1b884d745a22b17b5d72a.zip
prosodyctl about: Use library function for sorted listing of lua modules
Code reuse and one less module to import is nice.
-rwxr-xr-xprosodyctl8
1 files changed, 3 insertions, 5 deletions
diff --git a/prosodyctl b/prosodyctl
index 6b82e678..b5361d95 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -378,8 +378,7 @@ function commands.about(arg)
end
local pwd = ".";
- local array = require "util.array";
- local keys = require "util.iterators".keys;
+ local sorted_pairs = require "util.iterators".sorted_pairs;
local hg = require"util.mercurial";
local relpath = configmanager.resolve_relative_path;
@@ -461,9 +460,8 @@ function commands.about(arg)
end
module_versions["libunbound"] = lunbound._LIBVER;
end
- local sorted_keys = array.collect(keys(module_versions)):sort();
- for _, name in ipairs(sorted_keys) do
- print(name..":"..string.rep(" ", longest_name-#name), module_versions[name]);
+ for name, version in sorted_pairs(module_versions) do
+ print(name..":"..string.rep(" ", longest_name-#name), version);
end
print("");
end