prosodyctl
changeset 10128 5a3611218709
parent 10127 5d132d4aac55
child 10129 58fe5cff5ca2
equal deleted inserted replaced
10127:5d132d4aac55 10128:5a3611218709
    85 local commands = {};
    85 local commands = {};
    86 local command = table.remove(arg, 1);
    86 local command = table.remove(arg, 1);
    87 
    87 
    88 function commands.test()
    88 function commands.test()
    89 	show_message [[Well, hello there!]]
    89 	show_message [[Well, hello there!]]
    90 	--show_message [[Enabled Plugins: ], modulemanager.get_modules_for_host()]
       
    91 	show_warning("Trying to peek at the plugin directory: '%s'", modulemanager.get_modules_for_host())
    90 	show_warning("Trying to peek at the plugin directory: '%s'", modulemanager.get_modules_for_host())
       
    91 end
       
    92 
       
    93 function commands.local_plugins()
       
    94 	local directory = "./plugins"
       
    95     local i, t, popen = 0, {}, io.popen
       
    96     local pfile = popen('ls -a "'..directory..'"')
       
    97     for filename in pfile:lines() do
       
    98 		if filename == "." or filename == ".." then
       
    99 			i = i + 1
       
   100 		else
       
   101 			i = i + 1
       
   102 			t[i] = filename
       
   103 			show_warning("%s", t[i])
       
   104         end
       
   105     end
       
   106     pfile:close()
    92 end
   107 end
    93 
   108 
    94 function commands.adduser(arg)
   109 function commands.adduser(arg)
    95 	if not arg[1] or arg[1] == "--help" then
   110 	if not arg[1] or arg[1] == "--help" then
    96 		show_usage([[adduser JID]], [[Create the specified user account in Prosody]]);
   111 		show_usage([[adduser JID]], [[Create the specified user account in Prosody]]);