Skip to content

Commit 29760ce

Browse files
authored
[lldb] Fix capitalization in ambiguous command error (#171519)
We follow LLVM's style guide for diagnostics, which instructs to start the first sentence with a lowercase letter, and finish the last sentence without a period, if it would end in one otherwise.
1 parent dda715d commit 29760ce

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,12 +3702,10 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line,
37023702
done = static_cast<bool>(cmd_obj);
37033703
} else {
37043704
StreamString error_msg;
3705-
error_msg.Printf("Ambiguous command '%s'. Possible matches:\n",
3705+
error_msg.Printf("ambiguous command '%s'. Possible matches:\n",
37063706
next_word.c_str());
3707-
3708-
for (uint32_t i = 0; i < num_matches; ++i) {
3707+
for (uint32_t i = 0; i < num_matches; ++i)
37093708
error_msg.Printf("\t%s\n", matches.GetStringAtIndex(i));
3710-
}
37113709
result.AppendError(error_msg.GetString());
37123710
}
37133711
} else {

lldb/test/API/functionalities/abbreviation/TestAbbreviations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_command_abbreviations_and_aliases(self):
4141
# "pl" could be "platform" or "plugin".
4242
command_interpreter.ResolveCommand("pl", result)
4343
self.assertFalse(result.Succeeded())
44-
self.assertTrue(result.GetError().startswith("error: Ambiguous command"))
44+
self.assertTrue(result.GetError().startswith("error: ambiguous command"))
4545

4646
# Make sure an unabbreviated command is not mangled.
4747
command_interpreter.ResolveCommand(

lldb/test/API/functionalities/ambigous_commands/TestAmbiguousCommands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_ambiguous_command_with_alias(self):
2424
self.assertFalse(result.Succeeded())
2525
self.assertEqual(
2626
result.GetError(),
27-
"error: Ambiguous command 'co'. Possible matches:\n\tcommand\n\tcontinue\n\tcorefile\n",
27+
"error: ambiguous command 'co'. Possible matches:\n\tcommand\n\tcontinue\n\tcorefile\n",
2828
)
2929

3030
command_interpreter.HandleCommand("command unalias continue", result)

lldb/test/API/functionalities/wrong_commands/TestWrongCommands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_ambiguous_command(self):
1818
command_interpreter.HandleCommand("g", result)
1919
self.assertFalse(result.Succeeded())
2020
self.assertRegex(
21-
result.GetError(), "error: Ambiguous command 'g'. Possible matches:"
21+
result.GetError(), "error: ambiguous command 'g'. Possible matches:"
2222
)
2323
self.assertRegex(result.GetError(), "gui")
2424
self.assertRegex(result.GetError(), "gdb-remote")

0 commit comments

Comments
 (0)