summaryrefslogtreecommitdiff
path: root/modules/operserv/news.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/operserv/news.cpp')
-rw-r--r--modules/operserv/news.cpp18
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> &params) 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