chanservaddcommand("checkhashpass", QCMD_OPER, 3, csa_docheckhashpass, "Checks supplied password against a version hashed in the database.", "");
chanservaddcommand("email", QCMD_SECURE | QCMD_AUTHED, 3, csa_doemail, "Change your email address.", "");
chanservaddcommand("hello", QCMD_NOTAUTHED, 2, csa_dohello, "Creates a new user account.", "");
- chanservaddcommand("login", QCMD_SECURE | QCMD_NOTAUTHED, 2, csa_doauth, "Authenticates you on the bot.", "");
+ chanservaddcommand("login", QCMD_SECURE | QCMD_NOTAUTHED, 2, csa_doauth, "Authenticates you on the bot.", "Usage: login <username> <password>\nAuthenticates using the supplied username and password.\n");
chanservaddcommand("newpass", QCMD_SECURE | QCMD_AUTHED, 3, csa_donewpw, "Change your password.", "");
chanservaddcommand("requestpassword", QCMD_NOTAUTHED, 2, csa_doreqpw, "Requests the current password by email.", "");
chanservaddcommand("setemail", QCMD_OPER, 2, csa_dosetmail, "Set the email address.", "");
* CMDDESC: Authenticates you on the bot.
* CMDFUNC: csa_doauth
* CMDPROTO: int csa_doauth(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: login <username> <password>
+ * CMDHELP: Authenticates using the supplied username and password.
*/
#include "../chanserv.h"
my @cmdfunc;
my @protos;
my @files;
+my @help;
my @filelist = <*.c>;
next if (/commandlist.c/);
my $fname = $_;
- my ($cn, $cl, $ca, $cd, $cf, $cp);
+ my ($cn, $cl, $ca, $cd, $cf, $cp, $ch);
+ $ch="";
open INFILE,"<$fname";
if (/CMDPROTO: (.*)/) {
$cp=$1;
}
+
+ if (/CMDHELP: (.*)/) {
+ $ch.=$1."\\n";
+ }
}
if (defined $cn and defined $cl and defined $ca and defined $cd and defined $cf and defined $cp) {
push @cmddesc, $cd;
push @cmdfunc, $cf;
push @protos, $cp;
+ push @help, $ch;
} else {
print "Warning: found source file $fname without complete tags, skipping...\n";
}
while (my $cn = shift @cmdnames) {
print CL " chanservaddcommand(\"".$cn."\", ".(shift @cmdlevels).", ".(shift @cmdargs).", ";
- print CL (shift @cmdfunc).", \"".(shift @cmddesc)."\", \"\");\n";
+ print CL (shift @cmdfunc).", \"".(shift @cmddesc)."\", \"".(shift @help),"\");\n";
}
print CL "}\n\nvoid _fini() {\n";