jingham created this revision.
jingham added reviewers: JDevlieghere, jasonmolenda.
Herald added a project: All.
jingham requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

For some reason (lost in the mists of time) CommandObjectMultiword will check 
to see if you've passed it an argument with the text value "help" and if it 
sees that, it will print help.

That's not how the lldb help system works, and this is nowhere documented.  
It's not terribly discoverable, and doesn't behave like the rest of the lldb 
command system - doesn't auto-complete, doesn't do shortest unique match, 
etc...  It also doesn't work for anything but the first level in the hierarchy:

  (lldb) break help 
  Commands for operating on breakpoints (see 'help b' for shorthand.)
  
  Syntax: breakpoint <subcommand> [<command-options>]
  ...

But:

  (lldb) break set help
  error: invalid combination of options for the given command

It is also confusing if you happen across it because then you think that's the 
way the help system works which it isn't.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142067

Files:
  lldb/source/Commands/CommandObjectMultiword.cpp


Index: lldb/source/Commands/CommandObjectMultiword.cpp
===================================================================
--- lldb/source/Commands/CommandObjectMultiword.cpp
+++ lldb/source/Commands/CommandObjectMultiword.cpp
@@ -174,11 +174,6 @@
     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());


Index: lldb/source/Commands/CommandObjectMultiword.cpp
===================================================================
--- lldb/source/Commands/CommandObjectMultiword.cpp
+++ lldb/source/Commands/CommandObjectMultiword.cpp
@@ -174,11 +174,6 @@
     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());
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to