Skip to content

Commit 25e9792

Browse files
committed
Add explicit alias for h -> help instead of relying on the order of lookup.
1 parent 2763c7e commit 25e9792

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,11 @@ void CommandInterpreter::Initialize() {
508508
if (cmd_obj_sp) {
509509
AddAlias("history", cmd_obj_sp);
510510
}
511+
512+
cmd_obj_sp = GetCommandSPExact("help");
513+
if (cmd_obj_sp) {
514+
AddAlias("h", cmd_obj_sp);
515+
}
511516
}
512517

513518
void CommandInterpreter::Clear() {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ def test_command_abbreviations_and_aliases(self):
2020
self.assertTrue(result.Succeeded())
2121
self.assertEqual("apropos script", result.GetOutput())
2222

23-
# "h" could be "help" or "history", "he" can only be "help".
24-
command_interpreter.ResolveCommand("he", result)
23+
command_interpreter.ResolveCommand("h", result)
2524
self.assertTrue(result.Succeeded())
2625
self.assertEqual("help", result.GetOutput())
2726

0 commit comments

Comments
 (0)