diff options
author | Adam <Adam@anope.org> | 2017-11-19 16:11:35 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-11-19 16:11:35 -0500 |
commit | 2fda0fff4655e92e388d7823e5b1c1f0c6bcfe2d (patch) | |
tree | b2cde60f3c2c98782690d67d134263924f59cc78 /modules/operserv/news.cpp | |
parent | 3fb9bb5118a5c3c6c916a48feed0e069867f3133 (diff) |
Add subcommand syntax help, and reference subcommand help in syntax error messages
Diffstat (limited to 'modules/operserv/news.cpp')
-rw-r--r-- | modules/operserv/news.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/modules/operserv/news.cpp b/modules/operserv/news.cpp index ae81f09ef..1a8ba7f10 100644 --- a/modules/operserv/news.cpp +++ b/modules/operserv/news.cpp @@ -290,7 +290,7 @@ class NewsBase : public Command else if (cmd.equals_ci("DEL")) return this->DoDel(source, params, ntype, msgs); else - this->OnSyntaxError(source, ""); + this->OnSyntaxError(source); } public: NewsBase(Module *creator, const Anope::string &newstype) : Command(creator, newstype, 1, 2) @@ -303,6 +303,22 @@ class NewsBase : public Command virtual void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_abstract; virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_abstract; + + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = "") override + { + if (subcommand.equals_ci("ADD")) + { + SubcommandSyntaxError(source, subcommand, _("\037text\037")); + } + else if (subcommand.equals_ci("DEL")) + { + SubcommandSyntaxError(source, subcommand, _("{\037num\037 | ALL}")); + } + else + { + Command::OnSyntaxError(source, subcommand); + } + } }; class CommandOSLogonNews : public NewsBase |