| 1 |
pippijn |
1.5 |
/** |
| 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 |
pippijn |
1.4 |
* Copyright © 2005 Atheme Development Group |
| 10 |
pippijn |
1.2 |
* Rights to this code are documented in doc/pod/license.pod. |
| 11 |
pippijn |
1.1 |
* |
| 12 |
pippijn |
1.6 |
* $Id: help.C,v 1.5 2007-09-16 18:54:43 pippijn Exp $ |
| 13 |
pippijn |
1.1 |
*/ |
| 14 |
|
|
|
| 15 |
|
|
#include "atheme.h" |
| 16 |
pippijn |
1.4 |
#include <ermyth/module.h> |
| 17 |
pippijn |
1.1 |
|
| 18 |
pippijn |
1.6 |
static char const rcsid[] = "$Id: help.C,v 1.5 2007-09-16 18:54:43 pippijn Exp $"; |
| 19 |
pippijn |
1.1 |
|
| 20 |
pippijn |
1.6 |
REGISTER_MODULE ("gameserv/help", false, "The Ermyth Team <http://ermyth.xinutec.org>"); |
| 21 |
pippijn |
1.1 |
|
| 22 |
pippijn |
1.4 |
E cmdvec gs_cmdtree; |
| 23 |
|
|
E helpvec gs_helptree; |
| 24 |
pippijn |
1.1 |
|
| 25 |
|
|
static void gs_cmd_help (sourceinfo_t *si, int parc, char *parv[]); |
| 26 |
|
|
|
| 27 |
pippijn |
1.4 |
command_t const gs_help = { "HELP", N_("Displays contextual help information."), AC_NONE, 2, gs_cmd_help }; |
| 28 |
pippijn |
1.1 |
|
| 29 |
pippijn |
1.4 |
bool |
| 30 |
|
|
_modinit (module *m) |
| 31 |
pippijn |
1.1 |
{ |
| 32 |
|
|
gs_cmdtree << gs_help; |
| 33 |
|
|
help_addentry (gs_helptree, "HELP", "help/help", NULL); |
| 34 |
pippijn |
1.4 |
|
| 35 |
|
|
return true; |
| 36 |
pippijn |
1.1 |
} |
| 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 |
|
|
*/ |