summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-07-28 00:13:41 +0000
committerGravatar brain2006-07-28 00:13:41 +0000
commitdc8f5d02f77aeabefaefe88005b99c8b47030ab7 (patch)
tree89ce56baff165606f8c16036b0a8d65459d53cb1 /src/command_parse.cpp
parentAdd VF_SERVICEPROVIDER (diff)
Add support for syntax of commands in place of the text 'Not enough parameters' in numeric 461, where supported.
To support this each derived class of command_t must set the value of command_t::syntax to a non-empty string. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4561 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 8e704e796..1a32456b2 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -232,7 +232,12 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
if (items < cm->second->min_params)
{
log(DEBUG,"not enough parameters: %s %s",user->nick,command.c_str());
- WriteServ(user->fd,"461 %s %s :Not enough parameters",user->nick,command.c_str());
+
+ /* If syntax is given, display this as the 461 reply */
+ if (cm->second->syntax.length())
+ WriteServ(user->fd,"461 %s %s :Syntax: %s %s", cm->second->command.c_str(), cm->second->syntax.c_str());
+ else
+ WriteServ(user->fd,"461 %s %s :Not enough parameters",user->nick,command.c_str());
return;
}
if (cm->second->flags_needed)