[lldb] Print an error message for an empty subcommand

llvm-svn: 373053
This commit is contained in:
Raphael Isemann 2019-09-27 08:49:41 +00:00
parent c006b6f4cb
commit 2096518d58
2 changed files with 4 additions and 3 deletions

View File

@ -20,8 +20,7 @@ class MultiwordCommandsTestCase(TestBase):
@no_debug_info_test
def test_empty_subcommand(self):
# FIXME: This has no error message.
self.expect("platform \"\"", error=True)
self.expect("platform \"\"", error=True, substrs=["Need to specify a non-empty subcommand."])
@no_debug_info_test
def test_help(self):

View File

@ -94,8 +94,10 @@ bool CommandObjectMultiword::Execute(const char *args_string,
}
auto sub_command = args[0].ref();
if (sub_command.empty())
if (sub_command.empty()) {
result.AppendError("Need to specify a non-empty subcommand.");
return result.Succeeded();
}
if (sub_command.equals_lower("help")) {
this->CommandObject::GenerateHelpText(result);