]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc.c
- Added "HELP" command.
[ngircd-alex.git] / src / ngircd / irc.c
index 7cdb4dadef5431796733e312f9a0ad7c88647142..98ee042e4845cb8917fae58d3dd793b5c92d709b 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc.c,v 1.117 2003/01/13 18:56:30 alex Exp $";
+static char UNUSED id[] = "$Id: irc.c,v 1.118 2003/01/15 13:49:20 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -226,4 +226,25 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
 } /* IRC_TRACE */
 
 
+GLOBAL BOOLEAN
+IRC_HELP( CLIENT *Client, REQUEST *Req )
+{
+       COMMAND *cmd;
+
+       assert( Client != NULL );
+       assert( Req != NULL );
+
+       /* Bad number of arguments? */
+       if( Req->argc > 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
+
+       cmd = Parse_GetCommandStruct( );
+       while( cmd->name )
+       {
+               if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED;
+               cmd++;
+       }
+       return CONNECTED;
+} /* IRC_HELP */
+
+
 /* -eof- */