[Git][reproducible-builds/diffoscope][master] 3 commits: Refer to the Debian package names in the --help output when indicating how to...

Chris Lamb gitlab at salsa.debian.org
Tue Feb 19 18:03:58 CET 2019


Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
cb6da078 by Chris Lamb at 2019-02-19T17:03:14Z
Refer to the Debian package names in the --help output when indicating how to obtain the tlsh and argcomplete modules.

- - - - -
d8113a84 by Chris Lamb at 2019-02-19T17:03:28Z
Indent and wrap the list of supported file formats in the --help output.

- - - - -
c4eea5a9 by Chris Lamb at 2019-02-19T17:03:48Z
Include links to the diffoscope homepage and bug tracker in --help output.

- - - - -


1 changed file:

- diffoscope/main.py


Changes:

=====================================
diffoscope/main.py
=====================================
@@ -25,6 +25,7 @@ import sys
 import json
 import signal
 import logging
+import textwrap
 import argparse
 import traceback
 
@@ -428,15 +429,17 @@ def create_parser():
         parser.epilog = (
             'File renaming detection based on fuzzy-matching is currently '
             'disabled. It can be enabled by installing the "tlsh" module '
-            'available at https://github.com/trendmicro/tlsh'
+            'available from https://github.com/trendmicro/tlsh or in the '
+            'python3-tlsh package.'
         )
     if argcomplete:
         argcomplete.autocomplete(parser)
     elif '_ARGCOMPLETE' in os.environ:
         logger.error(
             'Argument completion requested but the "argcomplete" module is '
-            'not installed. It can be obtained at '
-            'https://pypi.python.org/pypi/argcomplete'
+            'not installed. It can be obtained from '
+            'https://pypi.python.org/pypi/argcomplete or in the '
+            'python3-argcomplete package.'
         )
         sys.exit(1)
 
@@ -467,10 +470,29 @@ class HelpFormatter(argparse.HelpFormatter):
         if not set(sys.argv) & {'--help', '-h'}:
             return val
 
+        def append(title, content, indent=24, max_width=78):
+            nonlocal val
+            wrapped = textwrap.fill(content, max_width - indent)
+            val += '\n{}:\n{}\n'.format(
+                title, textwrap.indent(wrapped, ' ' * indent)
+            )
+
         descriptions = list(sorted(ComparatorManager().get_descriptions()))
-        val = '{}\n\nfile formats supported:\n{}{} and {}.\n'.format(
-            val, ' ' * 24, ', '.join(descriptions[:-1]), descriptions[-1]
+        append(
+            'file formats supported',
+            '{} and {}.\n'.format(
+                ', '.join(descriptions[:-1]), descriptions[-1]
+            ),
         )
+
+        append('diffoscope homepage', '<https://diffoscope.org/>')
+
+        append(
+            'bugs/issues',
+            '<https://salsa.debian.org/reproducible-builds/diffoscope/issues>',
+            max_width=sys.maxsize,
+        )
+
         return val
 
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/32199ce45727e2d6246cf328008e81d451c7bfc1...c4eea5a959f7f74cf4f29e372b61cfd6691df1f3

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/32199ce45727e2d6246cf328008e81d451c7bfc1...c4eea5a959f7f74cf4f29e372b61cfd6691df1f3
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190219/52c02294/attachment.html>


More information about the rb-commits mailing list