Commit 822ca3f1 authored by Chris Lamb's avatar Chris Lamb 💬

Require that "-" is explicitly specified to read a single diff from standard...

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: #54)
parent c1f202c4
Pipeline #41620 passed with stage
in 15 minutes and 27 seconds
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment