print help from helpdb on CR_WRONG_USAGE

develop
myk002 2022-07-22 17:45:48 -07:00
parent 65b3ce6e96
commit 0858b95c40
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 5 additions and 3 deletions

@ -1197,7 +1197,11 @@ command_result Core::runCommand(color_ostream &con, const std::string &first_, v
else
{
res = plug_mgr->InvokeCommand(con, first, parts);
if(res == CR_NOT_IMPLEMENTED)
if (res == CR_WRONG_USAGE)
{
help_helper(con, first);
}
else if (res == CR_NOT_IMPLEMENTED)
{
string completed;
string filename = findScript(first + ".lua");

@ -503,8 +503,6 @@ command_result Plugin::invoke(color_ostream &out, const std::string & command, s
{
cr = cmd.function(out, parameters);
}
if (cr == CR_WRONG_USAGE && !cmd.usage.empty())
out << "Usage:\n" << cmd.usage << flush;
break;
}
}