[diffoscope] 01/02: diffoscope.main: Move --text fallback to output utility method

Chris Lamb chris at chris-lamb.co.uk
Mon Jan 2 11:23:10 CET 2017


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 24f9ddee130ff7e150435c56372bd413e02f59a7
Author: Chris Lamb <lamby at debian.org>
Date:   Mon Jan 2 10:22:20 2017 +0000

    diffoscope.main: Move --text fallback to output utility method
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/main.py             | 3 ---
 diffoscope/presenters/utils.py | 8 ++++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/diffoscope/main.py b/diffoscope/main.py
index 6073615..b8b2882 100644
--- a/diffoscope/main.py
+++ b/diffoscope/main.py
@@ -224,9 +224,6 @@ def run_diffoscope(parsed_args):
     if parsed_args.debug:
         logger.setLevel(logging.DEBUG)
     set_locale()
-    # no output desired? print text to stdout
-    if not any((parsed_args.text_output, parsed_args.html_output, parsed_args.html_output_directory)):
-        parsed_args.text_output = "-"
     logger.debug('Starting comparison')
     ProgressManager().setup(parsed_args)
     with Progress(1, parsed_args.path1):
diff --git a/diffoscope/presenters/utils.py b/diffoscope/presenters/utils.py
index 5ee8883..b054b63 100644
--- a/diffoscope/presenters/utils.py
+++ b/diffoscope/presenters/utils.py
@@ -33,6 +33,14 @@ def output_all(difference, parsed_args, has_differences):
     Generate all known output formats.
     """
 
+    # If no output specified, default to printing --text output to stdout
+    if not any((
+        parsed_args.text_output,
+        parsed_args.html_output,
+        parsed_args.html_output_directory,
+    )):
+        parsed_args.text_output = '-'
+
     for name, fn, target in (
         ('text', text, parsed_args.text_output),
         ('html', html, parsed_args.html_output),

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


More information about the diffoscope mailing list