From 2fda0fff4655e92e388d7823e5b1c1f0c6bcfe2d Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 19 Nov 2017 16:11:35 -0500 Subject: Add subcommand syntax help, and reference subcommand help in syntax error messages --- include/commands.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/commands.h b/include/commands.h index 1d8ad09af..853a30b48 100644 --- a/include/commands.h +++ b/include/commands.h @@ -127,6 +127,7 @@ class CoreExport Command : public Service /* Command requires that a user is executing it */ bool require_user = false; + static void SendHelpCommand(CommandSource &source, const Anope::string &subcommand); public: static constexpr const char *NAME = "Command"; @@ -157,7 +158,12 @@ class CoreExport Command : public Service void AllowUnregistered(bool b); void RequireUser(bool b); + /** + * send the syntax for this command + */ void SendSyntax(CommandSource &); + void SubcommandSyntaxError(CommandSource &source, const Anope::string &subcommand, const Anope::string &syntax); + bool AllowUnregistered() const; bool RequireUser() const; @@ -189,7 +195,7 @@ class CoreExport Command : public Service * @param source The source * @param subcommand The subcommand the user tried to use */ - virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand); + virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = ""); /** Runs a command * @param source The source of the command -- cgit