Bug 1079076 - 'diff --help' says that diff can handle more than 2 operands. 'diff' can not.
Summary: 'diff --help' says that diff can handle more than 2 operands. 'diff' can not.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: diffutils
Version: 19
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-20 22:43 UTC by Laurent Poirrier
Modified: 2014-03-28 10:20 UTC (History)
1 user (show)

Fixed In Version: diffutils-3.3-6.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-27 09:23:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.