Bug 1079076

Summary: 'diff --help' says that diff can handle more than 2 operands. 'diff' can not.
Product: [Fedora] Fedora Reporter: Laurent Poirrier <lpoirrier>
Component: diffutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 19CC: twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: diffutils-3.3-6.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-27 09:23:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Laurent Poirrier 2014-03-20 22:43:49 UTC
Description of problem:

'diff FILE... DIR' does not work with more than one element in 'FILE...' (and the same holds for 'diff DIR FILE...'). In other words diff refuses to take more than two operands.

Both 'diff --help' and the man page do allow more than two operands:

diff [OPTION]... FILES
[...]
FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE...' or 'FILE... DIR'.
[...]

Note however that the description in the POSIX man page (man-pages-3.51-2.fc19.noarch) does not allow for more than two operands. So a quick fix may be to just change the help message and the man page (and then diff would probably remain POSIX-compatible).


Version-Release number of selected component (if applicable):

diffutils-3.3-4.fc19.x86_64


How reproducible:

100%


Steps to Reproduce:

touch a b
mkdir -p dir
echo "A" > dir/a
echo "B" > dir/b
diff a b dir/


Actual results:

diff: extra operand 'dir/'
diff: Try 'diff --help' for more information.


Expected results:

diff ./a dir/a
0a1
> A
diff ./b dir/b
0a1
> B


Additional info:

Not a diff bug if considering the specification in the POSIX man page.
But in that case, 'diff --help' and 'man 1 diff' need updating.

Comment 1 Tim Waugh 2014-03-26 17:14:21 UTC
I see what you mean. I've asked about this upstream.

Comment 2 Tim Waugh 2014-03-27 09:23:42 UTC
It's been fixed upstream. Thanks for pointing it out.

I'll add this fix in for the next Fedora release.

Comment 3 Laurent Poirrier 2014-03-28 00:57:38 UTC
Ok, thanks for all.

(I have had a look at the upstream discussion, maybe you could just remind them to update the man page as well?... although it is not that essential)

Comment 4 Tim Waugh 2014-03-28 10:20:26 UTC
Thanks, I've reminded them.