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