Fix the formatting for help on option value types.

Patch by Jessica Han <jessicah@juniper.net>

https://reviews.llvm.org/D35525

llvm-svn: 309238
This commit is contained in:
Jim Ingham 2017-07-27 00:18:18 +00:00
parent 2195e13676
commit a81bd7f101
2 changed files with 10 additions and 1 deletions

View File

@ -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'])

View File

@ -2569,7 +2569,7 @@ void CommandInterpreter::OutputHelpText(Stream &strm, llvm::StringRef word_text,
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;