/** * help.C: This file contains routines to handle the OperServ HELP command. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2003-2004 E. Will et al. * Copyright © 2005-2006 Atheme Development Group * Rights to this code are documented in doc/pod/license.pod. * * $Id: help.C,v 1.8 2007/09/22 14:27:28 pippijn Exp $ */ #include "atheme.h" #include static char const rcsid[] = "$Id: help.C,v 1.8 2007/09/22 14:27:28 pippijn Exp $"; REGISTER_MODULE ("operserv/help", false, "The Ermyth Team "); static void os_cmd_help (sourceinfo_t *si, int parc, char *parv[]); command_t const os_help = { "HELP", N_("Displays contextual help information."), AC_NONE, 1, os_cmd_help }; E cmdvec os_cmdtree; E helpvec os_helptree; bool _modinit (module *m) { os_cmdtree << os_help; help_addentry (os_helptree, "HELP", "help/operserv/help", NULL); return true; } void _moddeinit () { os_cmdtree >> os_help; help_delentry (os_helptree, "HELP"); } /* HELP [params] */ static void os_cmd_help (sourceinfo_t *si, int parc, char *parv[]) { char *command = parv[0]; if (!has_any_privs (si)) { command_fail (si, fault::noprivs, _("You are not authorized to use %s."), opersvs.nick); return; } if (!command) { command_success_nodata (si, _("***** \2%s Help\2 *****"), opersvs.nick); command_success_nodata (si, _("\2%s\2 provides essential network management services, such as"), opersvs.nick); command_success_nodata (si, _("routing manipulation and access restriction. Please do not abuse")); command_success_nodata (si, _("your access to \2%s\2!"), opersvs.nick); command_success_nodata (si, " "); command_success_nodata (si, _("For information on a command, type:")); command_success_nodata (si, "\2/%s%s help \2", (ircd->uses_rcommand == false) ? "msg " : "", opersvs.disp); command_success_nodata (si, " "); command_help (si, os_cmdtree); command_success_nodata (si, _("***** \2End of Help\2 *****"), opersvs.nick); return; } /* take the command through the hash table */ help_display (si, command, os_helptree); } /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs * vim:ts=8 * vim:sw=8 * vim:noexpandtab */