| 1 |
/** |
| 2 |
* help.C: This file contains routines to handle the MemoServ HELP command. |
| 3 |
* |
| 4 |
* Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
| 5 |
* Rights to this code are as documented in COPYING. |
| 6 |
* |
| 7 |
* |
| 8 |
* Portions of this file were derived from sources bearing the following license: |
| 9 |
* Copyright © 2005 Atheme Development Group |
| 10 |
* Rights to this code are documented in doc/pod/license.pod. |
| 11 |
* |
| 12 |
* $Id: help.C,v 1.5 2007-09-16 18:54:43 pippijn Exp $ |
| 13 |
*/ |
| 14 |
|
| 15 |
#include "atheme.h" |
| 16 |
#include <ermyth/module.h> |
| 17 |
|
| 18 |
static char const rcsid[] = "$Id: help.C,v 1.5 2007-09-16 18:54:43 pippijn Exp $"; |
| 19 |
|
| 20 |
REGISTER_MODULE ("gameserv/help", false, "The Ermyth Team <http://ermyth.xinutec.org>"); |
| 21 |
|
| 22 |
E cmdvec gs_cmdtree; |
| 23 |
E helpvec gs_helptree; |
| 24 |
|
| 25 |
static void gs_cmd_help (sourceinfo_t *si, int parc, char *parv[]); |
| 26 |
|
| 27 |
command_t const gs_help = { "HELP", N_("Displays contextual help information."), AC_NONE, 2, gs_cmd_help }; |
| 28 |
|
| 29 |
bool |
| 30 |
_modinit (module *m) |
| 31 |
{ |
| 32 |
gs_cmdtree << gs_help; |
| 33 |
help_addentry (gs_helptree, "HELP", "help/help", NULL); |
| 34 |
|
| 35 |
return true; |
| 36 |
} |
| 37 |
|
| 38 |
void |
| 39 |
_moddeinit () |
| 40 |
{ |
| 41 |
gs_cmdtree >> gs_help; |
| 42 |
help_delentry (gs_helptree, "HELP"); |
| 43 |
} |
| 44 |
|
| 45 |
/* HELP <command> [params] */ |
| 46 |
void |
| 47 |
gs_cmd_help (sourceinfo_t *si, int parc, char *parv[]) |
| 48 |
{ |
| 49 |
char *command = parv[0]; |
| 50 |
|
| 51 |
if (!command) |
| 52 |
{ |
| 53 |
command_success_nodata (si, _("***** \2%s Help\2 *****"), gamesvs.nick); |
| 54 |
command_success_nodata (si, _("\2%s\2 provides games and tools for playing games to the network."), gamesvs.nick); |
| 55 |
command_success_nodata (si, " "); |
| 56 |
command_success_nodata (si, _("For more information on a command, type:")); |
| 57 |
command_success_nodata (si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", gamesvs.disp); |
| 58 |
command_success_nodata (si, " "); |
| 59 |
|
| 60 |
command_help (si, gs_cmdtree); |
| 61 |
|
| 62 |
command_success_nodata (si, _("***** \2End of Help\2 *****")); |
| 63 |
return; |
| 64 |
} |
| 65 |
|
| 66 |
/* take the command through the hash table */ |
| 67 |
help_display (si, command, gs_helptree); |
| 68 |
} |
| 69 |
|
| 70 |
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
| 71 |
* vim:ts=8 |
| 72 |
* vim:sw=8 |
| 73 |
* vim:noexpandtab |
| 74 |
*/ |