Repository: pallets/click

Issue:
Add newlines between options in help text
In case of multi-line help messages for options the list of options ``cmd --help`` gets difficult to read. It would be great to have an option to toggle extra newlines after multi-line help messages / in general between option help messages.


Discussion:
@chaoflow , what kind of setting would this look like? I poked around to see where it might work best, I'm thinking something like this:
```
# Add one newline after every option:
@click.command(context_settings=dict(help_newline_padding_size=1, help_newline_padding_style='all'))
# Or, add two newlines after each multi-line option
@click.command(context_settings=dict(help_newline_padding_size=2, help_newline_padding_style='multiline'))
```
Is this something that the maintainers would consider adding? If so, I think this implementation could be a good start. 
I don't want this to be an option. If you think it's more readable, just implement it as standard.
This seems to get the job done:
```
diff --git a/click/formatting.py b/click/formatting.py
index a3d6a4d..a8de859 100644
--- a/click/formatting.py
+++ b/click/formatting.py
@@ -200,10 +200,13 @@ class HelpFormatter(object):
             text_width = max(self.width - first_col - 2, 10)
             lines = iter(wrap_text(second, text_width).splitlines())
             if lines:
+                padding = ''
                 self.write(next(lines) + '\n')
                 for line in lines:
+                    padding = '\n'
                     self.write('%*s%s\n' % (
                         first_col + self.current_indent, '', line))
+                self.write(padding)
             else:
                 self.write('\n')
 ```
e: I modified the sample hello.py with a longer help message to show this at work:
```
Options:
  --count INTEGER  Number of greetings.
  --name TEXT      The person to greet. I made this help text quite long to
                   show that adding padding to the help message leaves this
                   alone.

  --help           Show this message and exit.
```
I could clean this up and open a pull request with some tests? (Interestingly, this change did not break any existing tests.)

Resolving patch:
diff --git a/click/formatting.py b/click/formatting.py
--- a/click/formatting.py
+++ b/click/formatting.py
@@ -206,6 +206,10 @@ def write_dl(self, rows, col_max=30, col_spacing=2):
 
                 for line in lines[1:]:
                     self.write('%*s%s\n' % (first_col + self.current_indent, '', line))
+
+                if len(lines) > 1:
+                    # separate long help from next option
+                    self.write("\n")
             else:
                 self.write('\n')
 


Test patch:
diff --git a/tests/test_formatting.py b/tests/test_formatting.py
--- a/tests/test_formatting.py
+++ b/tests/test_formatting.py
@@ -312,4 +312,40 @@ def cli():
         'Options:',
         '  -f TEXT  Output file name  [default: out.txt]',
         '  --help   Show this message and exit.  [default: False]'
-    ]
\ No newline at end of file
+    ]
+
+
+def test_formatting_usage_multiline_option_padding(runner):
+    @click.command('foo')
+    @click.option('--bar', help='This help message will be padded if it wraps.')
+    def cli():
+        pass
+
+    result = runner.invoke(cli, '--help', terminal_width=45)
+    assert not result.exception
+    assert result.output.splitlines() == [
+        'Usage: foo [OPTIONS]',
+        '',
+        'Options:',
+        '  --bar TEXT  This help message will be',
+        '              padded if it wraps.',
+        '',
+        '  --help      Show this message and exit.'
+    ]
+
+
+def test_formatting_usage_no_option_padding(runner):
+    @click.command('foo')
+    @click.option('--bar', help='This help message will be padded if it wraps.')
+    def cli():
+        pass
+
+    result = runner.invoke(cli, '--help', terminal_width=80)
+    assert not result.exception
+    assert result.output.splitlines() == [
+        'Usage: foo [OPTIONS]',
+        '',
+        'Options:',
+        '  --bar TEXT  This help message will be padded if it wraps.',
+        '  --help      Show this message and exit.'
+    ]