/** * help.C: This file contains routines to handle the MemoServ 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 © 2005 Atheme Development Group * Rights to this code are documented in doc/pod/license.pod. * * $Id: help.C,v 1.6 2007/09/22 14:27:27 pippijn Exp $ */ #include "atheme.h" #include static char const rcsid[] = "$Id: help.C,v 1.6 2007/09/22 14:27:27 pippijn Exp $"; REGISTER_MODULE ("memoserv/help", false, "The Ermyth Team "); E cmdvec ms_cmdtree; E helpvec ms_helptree; static void ms_cmd_help (sourceinfo_t *si, int parc, char *parv[]); command_t const ms_help = { "HELP", N_(N_("Displays contextual help information.")), AC_NONE, 2, ms_cmd_help }; bool _modinit (module *m) { ms_cmdtree << ms_help; help_addentry (ms_helptree, "HELP", "help/help", NULL); return true; } void _moddeinit () { ms_cmdtree >> ms_help; help_delentry (ms_helptree, "HELP"); } /* HELP [params] */ void ms_cmd_help (sourceinfo_t *si, int parc, char *parv[]) { char *command = parv[0]; if (!command) { command_success_nodata (si, _("***** \2%s Help\2 *****"), memosvs.nick); command_success_nodata (si, _("\2%s\2 allows users to send memos to registered users."), memosvs.nick); command_success_nodata (si, " "); command_success_nodata (si, _("For more information on a command, type:")); command_success_nodata (si, "\2/%s%s help \2", (ircd->uses_rcommand == false) ? "msg " : "", memosvs.disp); command_success_nodata (si, " "); command_help (si, ms_cmdtree); command_success_nodata (si, _("***** \2End of Help\2 *****")); return; } if (!strcasecmp ("COMMANDS", command)) { command_success_nodata (si, _("***** \2%s Help\2 *****"), nicksvs.nick); command_help (si, ms_cmdtree); command_success_nodata (si, _("***** \2End of Help\2 *****")); return; } /* take the command through the hash table */ help_display (si, command, ms_helptree); }