[Lldb-commits] [lldb] r309238 - Fix the formatting for help on option value types.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 26 17:18:18 PDT 2017


Author: jingham
Date: Wed Jul 26 17:18:18 2017
New Revision: 309238

URL: http://llvm.org/viewvc/llvm-project?rev=309238&view=rev
Log:
Fix the formatting for help on option value types.

Patch by Jessica Han <jessicah at juniper.net>

https://reviews.llvm.org/D35525

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py?rev=309238&r1=309237&r2=309238&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py Wed Jul 26 17:18:18 2017
@@ -230,3 +230,12 @@ class HelpCommandTestCase(TestBase):
             'command alias --long-help "I am a very friendly alias" -- averyfriendlyalias help')
         self.expect("help averyfriendlyalias", matching=True,
                     substrs=['I am a very friendly alias'])
+    @no_debug_info_test
+    def test_help_format_output(self):
+        """Test that help output reaches TerminalWidth."""
+        self.runCmd(
+            'settings set term-width 108')
+        self.expect(
+            "help format",
+            matching=True,
+            substrs=['<format> -- One of the format names'])

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=309238&r1=309237&r2=309238&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Wed Jul 26 17:18:18 2017
@@ -2569,7 +2569,7 @@ void CommandInterpreter::OutputHelpText(
 
   while (!text.empty()) {
     if (text.front() == '\n' ||
-        (text.front() == ' ' && nextWordLength(text.ltrim(' ')) < chars_left)) {
+        (text.front() == ' ' && nextWordLength(text.ltrim(' ')) > chars_left)) {
       strm.EOL();
       strm.Indent();
       chars_left = max_columns - indent_size;




More information about the lldb-commits mailing list