ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/operserv/help.C
Revision: 1.6
Committed: Thu Aug 30 19:56:24 2007 UTC (19 years, 1 month ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.5: +3 -3 lines
Log Message:
- put faultcodes into their own namespace
- removed old files
- limited header garbage in atheme.h
- macros to inline bools for connection_t::is_*
- put some connection_t functions into the connection_t class

File Contents

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