diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/multiword-commands/TestMultiWordCommands.py b/lldb/packages/Python/lldbsuite/test/functionalities/multiword-commands/TestMultiWordCommands.py index 12d572586c40..80b144f58d57 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/multiword-commands/TestMultiWordCommands.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/multiword-commands/TestMultiWordCommands.py @@ -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): diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index c0f5d6703f8e..03a3770d8df7 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -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);