[diffoscope] 01/01: Only append the file formats if --help is passed.

Chris Lamb chris at chris-lamb.co.uk
Fri Mar 23 15:14:05 CET 2018


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 3f9966440dc938ade1a533fe3ee036d02f2df3bb
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Mar 23 10:13:35 2018 -0400

    Only append the file formats if --help is passed.
---
 diffoscope/main.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/diffoscope/main.py b/diffoscope/main.py
index f34a2b8..1f8543d 100644
--- a/diffoscope/main.py
+++ b/diffoscope/main.py
@@ -271,6 +271,11 @@ def create_parser():
 class HelpFormatter(argparse.HelpFormatter):
     def format_help(self, *args, **kwargs):
         val = super().format_help(*args, **kwargs)
+
+        # Only append the file formats if --help is passed.
+        if not set(sys.argv) & {'--help', '-h'}:
+            return val
+
         val = '{}\n\nfile formats supported:\n'.format(val)
         for x in sorted(ComparatorManager().get_descriptions(), key=str.title):
             val = '{}{}- {}{}.\n\n'.format(val, ' ' * 24, x[0].upper(), x[1:])

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list