]> jfr.im git - irc/freenode/syn.git/blame - help.c
Add IRCCloud cloaking type
[irc/freenode/syn.git] / help.c
CommitLineData
0a30e865
SB
1/*
2 * syn: a utility bot to manage IRC network access
3 * Copyright (C) 2009-2016 Stephen Bennett
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19
4df09abf
SB
20#include "atheme.h"
21
22#include "syn.h"
23
4df09abf
SB
24static void syn_cmd_help(sourceinfo_t *si, int parc, char *parv[]);
25
26command_t syn_help = { "HELP", N_("Displays contextual help information."), "syn:general", 1, syn_cmd_help };
27
492a4dc0 28static void mod_init(module_t *m)
4df09abf
SB
29{
30 use_syn_main_symbols(m);
31
b918d5d9 32 service_named_bind_command("syn", &syn_help);
4df09abf
SB
33}
34
492a4dc0 35static void mod_deinit(module_unload_intent_t intent)
4df09abf 36{
b918d5d9 37 service_named_unbind_command("syn", &syn_help);
4df09abf
SB
38}
39
40/* HELP <command> [params] */
41void syn_cmd_help(sourceinfo_t *si, int parc, char *parv[])
42{
43 char *command = parv[0];
44
45 if (!command)
46 {
47 command_success_nodata(si, "***** \2%s Help\2 *****", syn->nick);
48
49 command_success_nodata(si, "\2%s\2 is a utility service to control access to the network.", syn->nick);
50 command_success_nodata(si, " ");
51
b918d5d9 52 command_help(si, syn->commands);
4df09abf
SB
53
54 command_success_nodata(si, _("***** \2End of Help\2 *****"));
55
56 return;
57 }
58
59 /* take the command through the hash table */
b918d5d9 60 help_display(si, syn, command, syn->commands);
4df09abf 61}
492a4dc0
JK
62
63DECLARE_MODULE_V1
64(
65 "syn/help", false, mod_init, mod_deinit,
66 "$Revision$",
67 "Stephen Bennett <stephen -at- freenode.net>"
68);