[Lldb-commits] [PATCH] D81783: [lldb] Remove indentation before help output.

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 12 21:33:39 PDT 2020


JDevlieghere created this revision.
JDevlieghere added reviewers: LLDB, jingham, labath, clayborg.
JDevlieghere updated this revision to Diff 270564.
JDevlieghere added a comment.

Explicit `llvm::StringRef` -> `std::string` conversion.


I always found it weird that there was this level of indentation before the first line of the help output. Supposedly it's meat to be aligned with the subcommands, but I find it visually confusion. This patch remove the indentation before the command help output.

**Before**

  (lldb) help breakpoint
       Commands for operating on breakpoints (see 'help b' for shorthand.)
  
  Syntax: breakpoint <subcommand> [<command-options>]
  
  The following subcommands are supported:
  
        clear   -- Delete or disable breakpoints matching the specified source file and line.`

**After**

  (lldb) help breakpoint
  Commands for operating on breakpoints (see 'help b' for shorthand.)
  
  Syntax: breakpoint <subcommand> [<command-options>]
  
  The following subcommands are supported:
  
        clear   -- Delete or disable breakpoints matching the specified source file and line.


https://reviews.llvm.org/D81783

Files:
  lldb/source/Interpreter/CommandObject.cpp


Index: lldb/source/Interpreter/CommandObject.cpp
===================================================================
--- lldb/source/Interpreter/CommandObject.cpp
+++ lldb/source/Interpreter/CommandObject.cpp
@@ -849,12 +849,11 @@
 
 void CommandObject::GenerateHelpText(Stream &output_strm) {
   CommandInterpreter &interpreter = GetCommandInterpreter();
+  std::string help_text(GetHelp());
   if (WantsRawCommandString()) {
-    std::string help_text(GetHelp());
     help_text.append("  Expects 'raw' input (see 'help raw-input'.)");
-    interpreter.OutputFormattedHelpText(output_strm, "", "", help_text, 1);
-  } else
-    interpreter.OutputFormattedHelpText(output_strm, "", "", GetHelp(), 1);
+  }
+  interpreter.OutputFormattedHelpText(output_strm, "", help_text);
   output_strm << "\nSyntax: " << GetSyntax() << "\n";
   Options *options = GetOptions();
   if (options != nullptr) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81783.270564.patch
Type: text/x-patch
Size: 895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200613/5d88d685/attachment.bin>


More information about the lldb-commits mailing list