1 |
/** |
2 |
* help.C: This file contains routines to handle the OperServ 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 © 2003-2004 E. Will et al. |
10 |
* Copyright © 2005-2006 Atheme Development Group |
11 |
* Rights to this code are documented in doc/pod/license.pod. |
12 |
* |
13 |
* $Id: help.C,v 1.7 2007-09-16 18:54:44 pippijn Exp $ |
14 |
*/ |
15 |
|
16 |
#include "atheme.h" |
17 |
#include <ermyth/module.h> |
18 |
|
19 |
static char const rcsid[] = "$Id: help.C,v 1.7 2007-09-16 18:54:44 pippijn Exp $"; |
20 |
|
21 |
REGISTER_MODULE ("operserv/help", false, "The Ermyth Team <http://ermyth.xinutec.org>"); |
22 |
|
23 |
static void os_cmd_help (sourceinfo_t *si, int parc, char *parv[]); |
24 |
|
25 |
command_t const os_help = { "HELP", N_("Displays contextual help information."), AC_NONE, 1, os_cmd_help }; |
26 |
|
27 |
E cmdvec os_cmdtree; |
28 |
E helpvec os_helptree; |
29 |
|
30 |
bool |
31 |
_modinit (module *m) |
32 |
{ |
33 |
os_cmdtree << os_help; |
34 |
help_addentry (os_helptree, "HELP", "help/operserv/help", NULL); |
35 |
|
36 |
return true; |
37 |
} |
38 |
|
39 |
void |
40 |
_moddeinit () |
41 |
{ |
42 |
os_cmdtree >> os_help; |
43 |
help_delentry (os_helptree, "HELP"); |
44 |
} |
45 |
|
46 |
/* HELP <command> [params] */ |
47 |
static void |
48 |
os_cmd_help (sourceinfo_t *si, int parc, char *parv[]) |
49 |
{ |
50 |
char *command = parv[0]; |
51 |
|
52 |
if (!has_any_privs (si)) |
53 |
{ |
54 |
command_fail (si, fault::noprivs, _("You are not authorized to use %s."), opersvs.nick); |
55 |
return; |
56 |
} |
57 |
|
58 |
if (!command) |
59 |
{ |
60 |
command_success_nodata (si, _("***** \2%s Help\2 *****"), opersvs.nick); |
61 |
command_success_nodata (si, _("\2%s\2 provides essential network management services, such as"), opersvs.nick); |
62 |
command_success_nodata (si, _("routing manipulation and access restriction. Please do not abuse")); |
63 |
command_success_nodata (si, _("your access to \2%s\2!"), opersvs.nick); |
64 |
command_success_nodata (si, " "); |
65 |
command_success_nodata (si, _("For information on a command, type:")); |
66 |
command_success_nodata (si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", opersvs.disp); |
67 |
command_success_nodata (si, " "); |
68 |
|
69 |
command_help (si, os_cmdtree); |
70 |
|
71 |
command_success_nodata (si, _("***** \2End of Help\2 *****"), opersvs.nick); |
72 |
return; |
73 |
} |
74 |
|
75 |
/* take the command through the hash table */ |
76 |
help_display (si, command, os_helptree); |
77 |
} |
78 |
|
79 |
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
80 |
* vim:ts=8 |
81 |
* vim:sw=8 |
82 |
* vim:noexpandtab |
83 |
*/ |