# HG changeset patch # User Jonas Schäfer # Date 1612194207 -3600 # Node ID 2047dd56cc40dcd596b77d7304da97a5fc38f0e7 # Parent 94805a7e7b30ffee336b8775e18912d8a3a81e55 mod_invites: add extensive help message diff -r 94805a7e7b30 -r 2047dd56cc40 mod_invites/mod_invites.lua --- a/mod_invites/mod_invites.lua Sun Jan 31 19:16:36 2021 +0100 +++ b/mod_invites/mod_invites.lua Mon Feb 01 16:43:27 2021 +0100 @@ -262,7 +262,31 @@ while #arg > 0 do local value = arg[1]; table.remove(arg, 1); - if value == "--reset" then + if value == "--help" then + print("usage: prosodyctl mod_"..module.name.." generate DOMAIN --reset USERNAME") + print("usage: prosodyctl mod_"..module.name.." generate DOMAIN [--admin] [--role ROLE] [--group GROUPID]...") + print() + print("This command has two modes: password reset and new account.") + print("If --reset is given, the command operates in password reset mode and in new account mode otherwise.") + print() + print("required arguments in password reset mode:") + print() + print(" --reset USERNAME Generate a password reset link for the given USERNAME.") + print() + print("optional arguments in new account mode:") + print() + print(" --admin Make the new user privileged") + print(" Equivalent to --role prosody:admin") + print(" --role ROLE Grant the given ROLE to the new user") + print(" --group GROUPID Add the user to the group with the given ID") + print(" Can be specified multiple times") + print() + print("--role and --admin override each other; the last one wins") + print("--group can be specified multiple times; the user will be added to all groups.") + print() + print("--reset and the other options cannot be mixed.") + return 2 + elseif value == "--reset" then local nodeprep = require "util.encodings".stringprep.nodeprep; local username = nodeprep(arg[1]) table.remove(arg, 1);