Software /
code /
prosody-modules
Diff
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 |
line wrap: on
line diff
--- a/mod_list_inactive/mod_list_inactive.lua Fri May 29 14:35:01 2015 +0200 +++ b/mod_list_inactive/mod_list_inactive.lua Mon Jun 08 15:27:28 2015 +0200 @@ -19,6 +19,15 @@ } function module.command(arg) + if #arg < 2 then + print("usage: prosodyctl mod_list_inactive example.net time [format]"); + print("time is a number followed by 'day', 'week', 'month' or 'year'"); + print("formats are:"); + for name, fmt in pairs(output_formats) do + print(name, fmt:format("user@example.com", "last action")) + end + return; + end local items = {}; local host = arg[1]; assert(hosts[host], "Host "..tostring(host).." does not exist");