summaryrefslogtreecommitdiff
path: root/modules/operserv
diff options
context:
space:
mode:
Diffstat (limited to 'modules/operserv')
-rw-r--r--modules/operserv/akill.cpp18
-rw-r--r--modules/operserv/chankill.cpp2
-rw-r--r--modules/operserv/config.cpp2
-rw-r--r--modules/operserv/defcon.cpp2
-rw-r--r--modules/operserv/dns.cpp2
-rw-r--r--modules/operserv/forbid.cpp2
-rw-r--r--modules/operserv/ignore.cpp16
-rw-r--r--modules/operserv/info.cpp22
-rw-r--r--modules/operserv/logsearch.cpp2
-rw-r--r--modules/operserv/news.cpp18
-rw-r--r--modules/operserv/noop.cpp2
-rw-r--r--modules/operserv/oper.cpp2
-rw-r--r--modules/operserv/session.cpp20
-rw-r--r--modules/operserv/set.cpp27
-rw-r--r--modules/operserv/sxline.cpp20
15 files changed, 127 insertions, 30 deletions
diff --git a/modules/operserv/akill.cpp b/modules/operserv/akill.cpp
index 8a752312a..8988fa743 100644
--- a/modules/operserv/akill.cpp
+++ b/modules/operserv/akill.cpp
@@ -386,7 +386,7 @@ class CommandOSAKill : public Command
else if (cmd.equals_ci("CLEAR"))
return this->DoClear(source);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
@@ -448,6 +448,22 @@ class CommandOSAKill : public Command
}
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = "") override
+ {
+ if (subcommand.equals_ci("ADD"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("[+\037expiry\037] \037mask\037 \037reason\037"));
+ }
+ else if (subcommand.equals_ci("DEL"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{\037mask\037 | \037entry-num\037 | \037list\037 | \037id\037}"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class OSAKill : public Module
diff --git a/modules/operserv/chankill.cpp b/modules/operserv/chankill.cpp
index 56e684acb..74aa04839 100644
--- a/modules/operserv/chankill.cpp
+++ b/modules/operserv/chankill.cpp
@@ -65,7 +65,7 @@ class CommandOSChanKill : public Command
if (params.size() <= last_param)
{
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
return;
}
diff --git a/modules/operserv/config.cpp b/modules/operserv/config.cpp
index 6a45ad5ca..5401452e1 100644
--- a/modules/operserv/config.cpp
+++ b/modules/operserv/config.cpp
@@ -127,7 +127,7 @@ class CommandOSConfig : public Command
}
else
{
- this->OnSyntaxError(source, what);
+ this->OnSyntaxError(source);
}
}
diff --git a/modules/operserv/defcon.cpp b/modules/operserv/defcon.cpp
index c7119d0ea..ac8470b00 100644
--- a/modules/operserv/defcon.cpp
+++ b/modules/operserv/defcon.cpp
@@ -209,7 +209,7 @@ class CommandOSDefcon : public Command
if (newLevel < 1 || newLevel > 5)
{
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
return;
}
diff --git a/modules/operserv/dns.cpp b/modules/operserv/dns.cpp
index 7ca4b0efa..dfa594520 100644
--- a/modules/operserv/dns.cpp
+++ b/modules/operserv/dns.cpp
@@ -798,7 +798,7 @@ class CommandOSDNS : public Command
else if (params[0].equals_ci("DEPOOL") && params.size() > 1)
this->OnDepool(source, params);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
diff --git a/modules/operserv/forbid.cpp b/modules/operserv/forbid.cpp
index 631f2d785..f071a3703 100644
--- a/modules/operserv/forbid.cpp
+++ b/modules/operserv/forbid.cpp
@@ -449,7 +449,7 @@ class CommandOSForbid : public Command
source.Reply(_("End of forbid list - \002{0}\002/\002{1}\002 entries shown."), shown, forbids.size());
}
else
- this->OnSyntaxError(source, command);
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
diff --git a/modules/operserv/ignore.cpp b/modules/operserv/ignore.cpp
index dbfeb0a66..a19722295 100644
--- a/modules/operserv/ignore.cpp
+++ b/modules/operserv/ignore.cpp
@@ -386,6 +386,22 @@ class CommandOSIgnore : public Command
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) override
+ {
+ if (subcommand.equals_ci("ADD"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("\037expiry\037 {\037nick\037|\037mask\037} [\037reason\037]"));
+ }
+ else if (subcommand.equals_ci("DEL"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{\037nick\037|\037mask\037}"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class OSIgnore : public Module
diff --git a/modules/operserv/info.cpp b/modules/operserv/info.cpp
index f4785ed88..d5131564c 100644
--- a/modules/operserv/info.cpp
+++ b/modules/operserv/info.cpp
@@ -167,7 +167,7 @@ class CommandOSInfo : public Command
{
if (info.empty())
{
- this->OnSyntaxError(source, cmd);
+ this->OnSyntaxError(source, "ADD");
return;
}
@@ -203,7 +203,7 @@ class CommandOSInfo : public Command
{
if (info.empty())
{
- this->OnSyntaxError(source, cmd);
+ this->OnSyntaxError(source, "DEL");
return;
}
@@ -254,7 +254,7 @@ class CommandOSInfo : public Command
}
else
{
- this->OnSyntaxError(source, cmd);
+ this->OnSyntaxError(source);
}
}
@@ -263,6 +263,22 @@ class CommandOSInfo : public Command
source.Reply(_("Add or delete oper information for a given account or channel. This information will show to opers in the respective info command for the account or channel."));
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = "") override
+ {
+ if (subcommand.equals_ci("ADD"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("\037target\037 \037info\037"));
+ }
+ else if (subcommand.equals_ci("DEL"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("\037target\037 \037info\037"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class OSInfo : public Module
diff --git a/modules/operserv/logsearch.cpp b/modules/operserv/logsearch.cpp
index 608e6da59..b4c3169b2 100644
--- a/modules/operserv/logsearch.cpp
+++ b/modules/operserv/logsearch.cpp
@@ -89,7 +89,7 @@ class CommandOSLogSearch : public Command
if (i >= params.size())
{
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
return;
}
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
diff --git a/modules/operserv/noop.cpp b/modules/operserv/noop.cpp
index 1168964c2..83e4184a6 100644
--- a/modules/operserv/noop.cpp
+++ b/modules/operserv/noop.cpp
@@ -78,7 +78,7 @@ class CommandOSNOOP : public Command
}
else
{
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
}
diff --git a/modules/operserv/oper.cpp b/modules/operserv/oper.cpp
index 106af76e1..fea4533ea 100644
--- a/modules/operserv/oper.cpp
+++ b/modules/operserv/oper.cpp
@@ -235,7 +235,7 @@ class CommandOSOper : public Command
}
else
{
- this->OnSyntaxError(source, subcommand);
+ this->OnSyntaxError(source);
}
}
diff --git a/modules/operserv/session.cpp b/modules/operserv/session.cpp
index dd366e02b..d84ee696a 100644
--- a/modules/operserv/session.cpp
+++ b/modules/operserv/session.cpp
@@ -312,7 +312,7 @@ class CommandOSSession : public Command
else if (cmd.equals_ci("VIEW"))
this->DoView(source, params);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
@@ -598,7 +598,7 @@ class CommandOSException : public Command
else if (cmd.equals_ci("VIEW"))
return this->DoView(source, params);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
@@ -626,6 +626,22 @@ class CommandOSException : public Command
" The difference is that \002{0} VIEW\002 is more verbose, displaying the name of the person who added the exception, its session limit, reason, host mask and the expiry date and time.\n"));
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = "") override
+ {
+ if (subcommand.equals_ci("ADD"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("[\037+expiry\037] \037mask\037 \037limit\037 \037reason\037"));
+ }
+ else if (subcommand.equals_ci("DEL"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{\037mask\037 | \037entry-num\037 | \037list\037}"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class OSSession : public Module
diff --git a/modules/operserv/set.cpp b/modules/operserv/set.cpp
index 3f05f7b91..6a3d9000a 100644
--- a/modules/operserv/set.cpp
+++ b/modules/operserv/set.cpp
@@ -198,7 +198,7 @@ class CommandOSSet : public Command
else if (option.equals_ci("SUPERADMIN"))
return this->DoSetSuperAdmin(source, params);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
@@ -213,32 +213,21 @@ class CommandOSSet : public Command
" LIST List the options"));
}
else if (subcommand.equals_ci("LIST"))
-#warning "?"
- //source.Reply(_("Syntax: \002LIST\002\n"
- // " \n"
source.Reply(("Display the various {0} settings."), source.service->nick);
else if (subcommand.equals_ci("READONLY"))
- //source.Reply(_("Syntax: \002READONLY {ON | OFF}\002\n"
- // " \n"
- source.Reply(_("Sets read-only mode on or off. In read-only mode, norma users will not be allowed to modify any Services data, including channel and nickname access lists, etc."
+ source.Reply(_("Sets read-only mode on or off. In read-only mode, normal users will not be allowed to modify any Services data, including channel and nickname access lists, etc."
"Services Operators will still be able to do most tasks, but should understand any changes they do may not be permanent.\n"
"\n"
"This option is equivalent to the command-line option \002--readonly\002."));
else if (subcommand.equals_ci("DEBUG"))
- //source.Reply(_("Syntax: \002DEBUG {ON | OFF}\002\n"
- // " \n"
source.Reply(_("Sets debug mode on or off.\n"
"\n"
"This option is equivalent to the command-line option \002--debug\002."));
else if (subcommand.equals_ci("NOEXPIRE"))
- //source.Reply(_("Syntax: \002NOEXPIRE {ON | OFF}\002\n"
- // " \n"
source.Reply(_("Sets no expire mode on or off. In no expire mode, nicks, channels, akills and exceptions won't expire until the option is unset.\n"
"\n"
"This option is equivalent to the command-line option \002--noexpire\002."));
else if (subcommand.equals_ci("SUPERADMIN"))
- //source.Reply(_("Syntax: \002SUPERADMIN {ON | OFF}\002\n"
- // " \n"
source.Reply(_("Setting this will grant you extra privileges, such as the ability to be \"founder\" on all channels."
"\n"
"This option is \002not\002 persistent, and should only be used when needed, and set back to OFF when no longer needed."));
@@ -247,6 +236,18 @@ class CommandOSSet : public Command
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = "") override
+ {
+ if (subcommand.equals_ci("READONLY") || subcommand.equals_ci("DEBUG") || subcommand.equals_ci("NOEXPIRE") || subcommand.equals_ci("SUPERADMIN"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{ON | OFF}"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class OSSet : public Module
diff --git a/modules/operserv/sxline.cpp b/modules/operserv/sxline.cpp
index d8d373aa5..ebd6204f9 100644
--- a/modules/operserv/sxline.cpp
+++ b/modules/operserv/sxline.cpp
@@ -217,10 +217,26 @@ class CommandOSSXLineBase : public Command
else if (cmd.equals_ci("CLEAR"))
return this->OnClear(source);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
- virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) override = 0;
+ virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) override anope_abstract;
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = "") override
+ {
+ if (subcommand.equals_ci("ADD"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("[+\037expiry\037] \037mask\037:\037reason\037"));
+ }
+ else if (subcommand.equals_ci("DEL"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{\037mask\037 | \037entry-num\037 | \037list\037 | \037id\037}"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class CommandOSSNLine : public CommandOSSXLineBase