]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r360437: diff(1): don't reject specifying the same format multiple times
authorKyle Evans <kevans@FreeBSD.org>
Sun, 3 May 2020 03:44:58 +0000 (03:44 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Sun, 3 May 2020 03:44:58 +0000 (03:44 +0000)
commitc68318d776f4736a317145fa122fa505289e626c
tree58dcabaf1bc1c1da6a72238a34a7e59f19789410
parentd2d6149be3b8f61c0322858f95e7730bdcc17060
MFC r360437: 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.
usr.bin/diff/diff.c
usr.bin/diff/tests/diff_test.sh