clix.lua

changeset 168
75e8ca131178
parent 166
b0c586241224
child 169
4e67d34c1298
--- a/clix.lua	Thu Mar 02 18:01:05 2023 +0100
+++ b/clix.lua	Fri May 26 22:39:38 2023 +0200
@@ -12,14 +12,16 @@
 	a = "account", p = "password", r = "resource", o = "presence", c = "chatroom", i = "interactive",
     f = "file" }
 
+
+local commands = "adhoc archive avatar bounce export mirror moderate ping\
+presence publish_atom raw receive roster send sendfile sendfilecontent vcard\
+version watch_pep"
 if #arg < 1 then
 	print("Command Line XMPP, available commands:");
-	for module in pairs(package.preload) do
-		if module:match("^clix%.") then
-			local m = require(module);
-			io.write("\t", module:gsub("^clix%.", ""), ": ");
-			m({ short_help = true }, {});
-		end
+	for command in commands:gmatch("%S+") do
+		local m = require("clix."..command);
+		io.write("\t", command, ": ");
+		m({ short_help = true }, {});
 	end
 	return 0;
 end
@@ -117,7 +119,7 @@
 
 	local clientkey, serverkey = account.clientkey, account.serverkey;
 	if clientkey and serverkey then
-		local hex = require "util.hex";
+		local hex = require "prosody.util.hex";
 		clientkey = hex.from(clientkey);
 		serverkey = hex.from(serverkey);
 	elseif clientkey or serverkey then

mercurial