1 /*
2  * Copyright (c) 2005 Atheme Development Group
3  * Rights to this code are documented in doc/LICENSE.
4  *
5  * This file contains routines to handle the GroupServ HELP command.
6  *
7  */
8 
9 #include "atheme.h"
10 
11 DECLARE_MODULE_V1
12 (
13 	"groupserv/help", false, _modinit, _moddeinit,
14 	PACKAGE_STRING,
15 	VENDOR_STRING
16 );
17 
18 static void gs_cmd_help(sourceinfo_t *si, int parc, char *parv[]);
19 
20 command_t gs_help = { "HELP", N_("Displays contextual help information."), AC_NONE, 1, gs_cmd_help, { .path = "help" } };
21 
gs_cmd_help(sourceinfo_t * si,int parc,char * parv[])22 void gs_cmd_help(sourceinfo_t *si, int parc, char *parv[])
23 {
24 	if (!parv[0])
25 	{
26 		command_success_nodata(si, _("***** \2%s Help\2 *****"), si->service->nick);
27 		command_success_nodata(si, _("\2%s\2 provides tools for managing groups of users and channels."), si->service->nick);
28 		command_success_nodata(si, " ");
29 		command_success_nodata(si, _("For more information on a command, type:"));
30 		command_success_nodata(si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", si->service->disp);
31 		command_success_nodata(si, " ");
32 
33 		command_help(si, si->service->commands);
34 
35 		command_success_nodata(si, _("***** \2End of Help\2 *****"));
36 		return;
37 	}
38 
39 	/* take the command through the hash table */
40 	help_display(si, si->service, parv[0], si->service->commands);
41 }
42 
_modinit(module_t * m)43 void _modinit(module_t *m)
44 {
45 	service_named_bind_command("groupserv", &gs_help);
46 }
47 
_moddeinit(module_unload_intent_t intent)48 void _moddeinit(module_unload_intent_t intent)
49 {
50 	service_named_unbind_command("groupserv", &gs_help);
51 }
52 
53