]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
diff(1): don't reject specifying the same format multiple times
authorKyle Evans <kevans@FreeBSD.org>
Tue, 28 Apr 2020 14:33:33 +0000 (14:33 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Tue, 28 Apr 2020 14:33:33 +0000 (14:33 +0000)
commit67c907653e3cfcc807c96e3419bacce3b5479f1c
tree2c5684d095ccab11dbd23a0f8686f886be9497e4
parenta9ea09e548882b7b15bcff47509b3d42618815cf
diff(1): don't reject specifying the same format multiple times

This may happen, for instance, if one happens to have an alias of diff to
diff -up and attempts to specify the amount of context on top of that.

Aliases like this may cause other problems, but if they're really not ever
generating non-unified diffs then we should at least not break that
use-case.

In addition, we'll now pick up a format mismatch if -p is specified with
!contextual && !unified && !unset.

Fix up a small trailing whitespace nit in the tests while we're here, and
add tests to make sure that we can double up all the formatting options.

Reported by: jbeich
MFC after: 3 days
usr.bin/diff/diff.c
usr.bin/diff/tests/diff_test.sh