[Lldb-commits] [lldb] 887240f - Remove the undocumented `help` subcommand.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 19 12:03:14 PST 2023


Author: Jim Ingham
Date: 2023-01-19T12:03:06-08:00
New Revision: 887240faf769395511d1568b4e50aafc6fe3b696

URL: https://github.com/llvm/llvm-project/commit/887240faf769395511d1568b4e50aafc6fe3b696
DIFF: https://github.com/llvm/llvm-project/commit/887240faf769395511d1568b4e50aafc6fe3b696.diff

LOG: Remove the undocumented `help` subcommand.

This is processed by hand in CommandObjectMultiword, and is undiscoverable,
it doesn't work in all cases.  Because it is a bare word, it can't really be
extended w/o introducing the possibility of collisions as well.  If we did
want to do something like this we should add a --help flag to CommandObject.  That
way the feature would be consistent and documented.

Differential Revision: https://reviews.llvm.org/D142067

Added: 
    

Modified: 
    lldb/source/Commands/CommandObjectMultiword.cpp
    lldb/test/API/functionalities/multiword-commands/TestMultiWordCommands.py

Removed: 
    


################################################################################
diff  --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index 6bcf0dea03868..bae2717ffe68e 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -174,11 +174,6 @@ bool CommandObjectMultiword::Execute(const char *args_string,
     return result.Succeeded();
   }
 
-  if (sub_command.equals_insensitive("help")) {
-    this->CommandObject::GenerateHelpText(result);
-    return result.Succeeded();
-  }
-
   if (m_subcommand_dict.empty()) {
     result.AppendErrorWithFormat("'%s' does not have any subcommands.\n",
                                  GetCommandName().str().c_str());

diff  --git a/lldb/test/API/functionalities/multiword-commands/TestMultiWordCommands.py b/lldb/test/API/functionalities/multiword-commands/TestMultiWordCommands.py
index e8b14d1629e1b..70a8b44b8d13f 100644
--- a/lldb/test/API/functionalities/multiword-commands/TestMultiWordCommands.py
+++ b/lldb/test/API/functionalities/multiword-commands/TestMultiWordCommands.py
@@ -19,13 +19,3 @@ def test_ambiguous_subcommand(self):
     @no_debug_info_test
     def test_empty_subcommand(self):
         self.expect("platform \"\"", error=True, substrs=["Need to specify a non-empty subcommand."])
-
-    @no_debug_info_test
-    def test_help(self):
-        # <multiword> help brings up help.
-        self.expect("platform help",
-                    substrs=["Commands to manage and create platforms.",
-                             "Syntax: platform [",
-                             "The following subcommands are supported:",
-                             "connect",
-                             "Select the current platform"])


        


More information about the lldb-commits mailing list