[Git][reproducible-builds/diffoscope][master] Require that "-" is explicitly specified to read a single diff from standard...

Chris Lamb gitlab at salsa.debian.org
Sun Mar 31 18:35:48 CEST 2019



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
822ca3f1 by Chris Lamb at 2019-03-31T16:35:27Z
Require that "-" is explicitly specified to read a single diff from standard input to avoid non-intuitive behaviour when diffoscope is called without any arguments. (Closes: reproducible-builds/diffoscope#54)

- - - - -


1 changed file:

- diffoscope/main.py


Changes:

=====================================
diffoscope/main.py
=====================================
@@ -86,9 +86,8 @@ def create_parser():
     )
     parser.add_argument(
         'path1',
-        nargs='?',
-        help='First file or directory to '
-        'compare. If omitted, tries to read a diffoscope diff from stdin.',
+        help='First file or directory to compare. Specify "-" to read a '
+        'diffoscope diff from stdin.',
     )
     parser.add_argument(
         'path2',
@@ -652,7 +651,7 @@ def run_diffoscope(parsed_args):
     path1, path2 = parsed_args.path1, parsed_args.path2
     if path2 is None:
         logger.debug("Loading diff from stdin")
-        if path1 is None or path1 == '-':
+        if path1 == '-':
             difference = load_diff(sys.stdin, "stdin")
         else:
             try:



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/822ca3f1b479c89bb086a08769ade19302aafa78

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/822ca3f1b479c89bb086a08769ade19302aafa78
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/20190331/af042dd7/attachment.html>


More information about the rb-commits mailing list