ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/memoserv/help.C
Revision: 1.2
Committed: Sat Jul 21 01:29:09 2007 UTC (19 years, 4 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.1: +2 -2 lines
Log Message:
- moved to new documentation system
- fixed small build error

File Contents

# User Rev Content
1 pippijn 1.1 /*
2     * Copyright © 2005 Atheme Development Group
3 pippijn 1.2 * Rights to this code are documented in doc/pod/license.pod.
4 pippijn 1.1 *
5     * This file contains routines to handle the MemoServ HELP command.
6     *
7 pippijn 1.2 * $Id: help.C,v 1.1 2007-07-19 08:24:54 pippijn Exp $
8 pippijn 1.1 */
9    
10     #include "atheme.h"
11    
12     static char const rcsid[] = "$Id";
13    
14     struct ms_help_listeners : callback::has_listeners
15     {
16     };
17    
18     ms_help_listeners listeners;
19    
20     DECLARE_MODULE_V1 ("memoserv/help", false, _modinit, _moddeinit, rcsid, "The Ermyth Team <http://ermyth.schmorp.de>");
21    
22     cmdvec *ms_cmdtree;
23     helpvec *ms_helptree;
24    
25     static void ms_cmd_help (sourceinfo_t *si, int parc, char *parv[]);
26    
27     command_t ms_help = { "HELP", N_(N_("Displays contextual help information.")), AC_NONE, 2, ms_cmd_help };
28    
29     void
30     _modinit (module_t *m)
31     {
32     MODULE_USE_SYMBOL_T (ms_cmdtree, cmdvec, "memoserv/main", "ms_cmdtree");
33     MODULE_USE_SYMBOL_T (ms_helptree, helpvec, "memoserv/main", "ms_helptree");
34    
35     ms_cmdtree << ms_help;
36     help_addentry (ms_helptree, "HELP", "help/help", NULL);
37     }
38    
39     void
40     _moddeinit ()
41     {
42     ms_cmdtree >> ms_help;
43     help_delentry (ms_helptree, "HELP");
44     }
45    
46     /* HELP <command> [params] */
47     void
48     ms_cmd_help (sourceinfo_t *si, int parc, char *parv[])
49     {
50     char *command = parv[0];
51    
52     if (!command)
53     {
54     command_success_nodata (si, _("***** \2%s Help\2 *****"), memosvs.nick);
55     command_success_nodata (si, _("\2%s\2 allows users to send memos to registered users."), memosvs.nick);
56     command_success_nodata (si, " ");
57     command_success_nodata (si, _("For more information on a command, type:"));
58     command_success_nodata (si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", memosvs.disp);
59     command_success_nodata (si, " ");
60    
61     command_help (si, ms_cmdtree);
62    
63     command_success_nodata (si, _("***** \2End of Help\2 *****"));
64     return;
65     }
66    
67     /* take the command through the hash table */
68     help_display (si, command, ms_helptree);
69     }
70    
71     /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
72     * vim:ts=8
73     * vim:sw=8
74     * vim:noexpandtab
75     */