]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r318316: uniq: allow -c to be used with -d or -u
authoremaste <emaste@FreeBSD.org>
Tue, 30 May 2017 16:55:15 +0000 (16:55 +0000)
committeremaste <emaste@FreeBSD.org>
Tue, 30 May 2017 16:55:15 +0000 (16:55 +0000)
commit10ed84a470ca0a5f1388a5e944d614fd57c1ea25
tree4baf5d7b069e7f34ce838cfe3d23d86618f410c5
parenta91af134655cb94d293a8d398490ac309734b4e8
MFC r318316: 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>
usr.bin/uniq/uniq.1
usr.bin/uniq/uniq.c