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/session.cpp | |
parent | 3fb9bb5118a5c3c6c916a48feed0e069867f3133 (diff) |
Add subcommand syntax help, and reference subcommand help in syntax error messages
Diffstat (limited to 'modules/operserv/session.cpp')
-rw-r--r-- | modules/operserv/session.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
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 |