forked from OSchip/llvm-project
[lldb] Print an error message for an empty subcommand
llvm-svn: 373053
This commit is contained in:
parent
c006b6f4cb
commit
2096518d58
|
@ -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):
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue