# HG changeset patch # User Kim Alvefur # Date 1373355490 -7200 # Node ID 59657e03c25c5ed397ef071a75c1c14c3ad01e81 # Parent bfde5e5318d780d23c6e9560f93fc56644af544b mod_lastlog: Make the command show a help message instead of a traceback when no user given diff -r bfde5e5318d7 -r 59657e03c25c mod_lastlog/mod_lastlog.lua --- a/mod_lastlog/mod_lastlog.lua Mon Jul 08 12:26:19 2013 +0200 +++ b/mod_lastlog/mod_lastlog.lua Tue Jul 09 09:38:10 2013 +0200 @@ -48,6 +48,10 @@ end function module.command(arg) + if not arg[1] or arg[1] == "--help" then + require"util.prosodyctl".show_usage([[mod_lastlog ]], [[Show when user last logged in or out]]); + return 1; + end local user, host = jid.prepped_split(table.remove(arg, 1)); require"core.storagemanager".initialize_host(host); local lastlog = assert(datamanager.load(user, host, "lastlog"));