]>
Commit | Line | Data |
---|---|---|
4df09abf SB |
1 | #include "atheme.h" |
2 | ||
3 | #include "syn.h" | |
4 | ||
4df09abf SB |
5 | static void syn_cmd_help(sourceinfo_t *si, int parc, char *parv[]); |
6 | ||
7 | command_t syn_help = { "HELP", N_("Displays contextual help information."), "syn:general", 1, syn_cmd_help }; | |
8 | ||
492a4dc0 | 9 | static void mod_init(module_t *m) |
4df09abf SB |
10 | { |
11 | use_syn_main_symbols(m); | |
12 | ||
b918d5d9 | 13 | service_named_bind_command("syn", &syn_help); |
4df09abf SB |
14 | } |
15 | ||
492a4dc0 | 16 | static void mod_deinit(module_unload_intent_t intent) |
4df09abf | 17 | { |
b918d5d9 | 18 | service_named_unbind_command("syn", &syn_help); |
4df09abf SB |
19 | } |
20 | ||
21 | /* HELP <command> [params] */ | |
22 | void syn_cmd_help(sourceinfo_t *si, int parc, char *parv[]) | |
23 | { | |
24 | char *command = parv[0]; | |
25 | ||
26 | if (!command) | |
27 | { | |
28 | command_success_nodata(si, "***** \2%s Help\2 *****", syn->nick); | |
29 | ||
30 | command_success_nodata(si, "\2%s\2 is a utility service to control access to the network.", syn->nick); | |
31 | command_success_nodata(si, " "); | |
32 | ||
b918d5d9 | 33 | command_help(si, syn->commands); |
4df09abf SB |
34 | |
35 | command_success_nodata(si, _("***** \2End of Help\2 *****")); | |
36 | ||
37 | return; | |
38 | } | |
39 | ||
40 | /* take the command through the hash table */ | |
b918d5d9 | 41 | help_display(si, syn, command, syn->commands); |
4df09abf | 42 | } |
492a4dc0 JK |
43 | |
44 | DECLARE_MODULE_V1 | |
45 | ( | |
46 | "syn/help", false, mod_init, mod_deinit, | |
47 | "$Revision$", | |
48 | "Stephen Bennett <stephen -at- freenode.net>" | |
49 | ); |