| 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 HostServ HELP command. |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "atheme.h" |
| 10 |
|
| 11 |
DECLARE_MODULE_V1 |
| 12 |
( |
| 13 |
"hostserv/help", false, _modinit, _moddeinit, |
| 14 |
PACKAGE_STRING, |
| 15 |
VENDOR_STRING |
| 16 |
); |
| 17 |
|
| 18 |
static void hs_cmd_help(sourceinfo_t *si, int parc, char *parv[]); |
| 19 |
|
| 20 |
command_t hs_help = { "HELP", N_(N_("Displays contextual help information.")), AC_NONE, 2, hs_cmd_help, { .path = "help" } }; |
| 21 |
|
| 22 |
void _modinit(module_t *m) |
| 23 |
{ |
| 24 |
service_named_bind_command("hostserv", &hs_help); |
| 25 |
} |
| 26 |
|
| 27 |
void _moddeinit(module_unload_intent_t intent) |
| 28 |
{ |
| 29 |
service_named_unbind_command("hostserv", &hs_help); |
| 30 |
} |
| 31 |
|
| 32 |
/* HELP <command> [params] */ |
| 33 |
void hs_cmd_help(sourceinfo_t *si, int parc, char *parv[]) |
| 34 |
{ |
| 35 |
char *command = parv[0]; |
| 36 |
|
| 37 |
if (!command) |
| 38 |
{ |
| 39 |
command_success_nodata(si, _("***** \2%s Help\2 *****"), si->service->nick); |
| 40 |
command_success_nodata(si, _("\2%s\2 allows users to request a virtual hostname."), si->service->nick); |
| 41 |
command_success_nodata(si, " "); |
| 42 |
command_success_nodata(si, _("For more information on a command, type:")); |
| 43 |
command_success_nodata(si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", si->service->disp); |
| 44 |
command_success_nodata(si, " "); |
| 45 |
|
| 46 |
command_help(si, si->service->commands); |
| 47 |
|
| 48 |
command_success_nodata(si, _("***** \2End of Help\2 *****")); |
| 49 |
return; |
| 50 |
} |
| 51 |
|
| 52 |
/* take the command through the hash table */ |
| 53 |
help_display(si, si->service, command, si->service->commands); |
| 54 |
} |
| 55 |
|
| 56 |
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
| 57 |
* vim:ts=8 |
| 58 |
* vim:sw=8 |
| 59 |
* vim:noexpandtab |
| 60 |
*/ |