freebsd-dev/usr.bin/uniq
Ed Maste a520574d76 uniq: allow -c to be used with -d or -u
Bring in some bits from NetBSD and lift the restriction in uniq(1) that
-c cannot be used with the -d and -u options.  This restriction seems
unnecessary and is supported at least by GNU, OpenBSD, and NetBSD.  Lift
the restriction and simplify the show() logic a little bit to maintain
functionality when -c is provided with -d/-u.

Also with this change, -d and -u are now actually a mutually exclusive,
albeit valid, combination.  Given that they both indicate opposite
behavior, uniq(1) will no longer output anything if both -d and -u are
supplied.  This is in line with NetBSD as well as GNU.

Adjust the man page and usage() to reflect that -c is its own standalone
option.

PR:		200553
Submitted by:	Kyle Evans <kevans91@ksu.edu>
Reviewed by:	cem, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D10694
2017-05-15 20:18:14 +00:00
..
tests Integrate .../contrib/netbsd-tests/usr.bin/uniq into the FreeBSD test 2017-01-14 06:51:31 +00:00
Makefile Integrate .../contrib/netbsd-tests/usr.bin/uniq into the FreeBSD test 2017-01-14 06:51:31 +00:00
Makefile.depend
uniq.1 uniq: allow -c to be used with -d or -u 2017-05-15 20:18:14 +00:00
uniq.c uniq: allow -c to be used with -d or -u 2017-05-15 20:18:14 +00:00