Comparison

mod_list_inactive/mod_list_inactive.lua @ 1766:e4c3d335b07f

mod_list_inactive: Print some usage info when not called with enough arguments
author Kim Alvefur <zash@zash.se>
date Mon, 08 Jun 2015 15:27:28 +0200
parent 1497:d1836dfa4ae4
child 3891:38504ec4c89b
comparison
equal deleted inserted replaced
1765:1a7867eaac9e 1766:e4c3d335b07f
17 event = "%s %s", 17 event = "%s %s",
18 delete = "user:delete%q -- %s" 18 delete = "user:delete%q -- %s"
19 } 19 }
20 20
21 function module.command(arg) 21 function module.command(arg)
22 if #arg < 2 then
23 print("usage: prosodyctl mod_list_inactive example.net time [format]");
24 print("time is a number followed by 'day', 'week', 'month' or 'year'");
25 print("formats are:");
26 for name, fmt in pairs(output_formats) do
27 print(name, fmt:format("user@example.com", "last action"))
28 end
29 return;
30 end
22 local items = {}; 31 local items = {};
23 local host = arg[1]; 32 local host = arg[1];
24 assert(hosts[host], "Host "..tostring(host).." does not exist"); 33 assert(hosts[host], "Host "..tostring(host).." does not exist");
25 sm.initialize_host(host); 34 sm.initialize_host(host);
26 um.initialize_host(host); 35 um.initialize_host(host);