From owner-svn-src-stable@freebsd.org Wed Jun 27 21:00:11 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3A0B1010E36; Wed, 27 Jun 2018 21:00:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9576E72D79; Wed, 27 Jun 2018 21:00:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 772293A0; Wed, 27 Jun 2018 21:00:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5RL0Amr095653; Wed, 27 Jun 2018 21:00:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5RL0A9F095651; Wed, 27 Jun 2018 21:00:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806272100.w5RL0A9F095651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 27 Jun 2018 21:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335738 - stable/11/usr.bin/cmp X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/cmp X-SVN-Commit-Revision: 335738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 21:00:11 -0000 Author: kevans Date: Wed Jun 27 21:00:09 2018 New Revision: 335738 URL: https://svnweb.freebsd.org/changeset/base/335738 Log: MFC r333157: cmp(1): Provide some long options These match GNU cmp(1) for compatibility where applicable. Future work might implement the -i option from GNU cmp(1) to express skip either in terms of both files or of the form "SKIP1:SKIP2" rather than specifying them as additional arguments to cmp(1). Modified: stable/11/usr.bin/cmp/cmp.1 stable/11/usr.bin/cmp/cmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/cmp/cmp.1 ============================================================================== --- stable/11/usr.bin/cmp/cmp.1 Wed Jun 27 20:55:49 2018 (r335737) +++ stable/11/usr.bin/cmp/cmp.1 Wed Jun 27 21:00:09 2018 (r335738) @@ -31,7 +31,7 @@ .\" @(#)cmp.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 18, 2013 +.Dd May 1, 2018 .Dt CMP 1 .Os .Sh NAME @@ -59,10 +59,10 @@ The following options are available: .Bl -tag -width indent .It Fl h Do not follow symbolic links. -.It Fl l +.It Fl l , Fl -verbose Print the byte number (decimal) and the differing byte values (octal) for each difference. -.It Fl s +.It Fl s , Fl -silent , Fl -quiet Print nothing for differing files; return exit status only. .It Fl x Modified: stable/11/usr.bin/cmp/cmp.c ============================================================================== --- stable/11/usr.bin/cmp/cmp.c Wed Jun 27 20:55:49 2018 (r335737) +++ stable/11/usr.bin/cmp/cmp.c Wed Jun 27 21:00:09 2018 (r335738) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -57,6 +58,14 @@ __FBSDID("$FreeBSD$"); int lflag, sflag, xflag, zflag; +static const struct option long_opts[] = +{ + {"verbose", no_argument, NULL, 'l'}, + {"silent", no_argument, NULL, 's'}, + {"quiet", no_argument, NULL, 's'}, + {NULL, no_argument, NULL, 0} +}; + static void usage(void); int @@ -68,7 +77,7 @@ main(int argc, char *argv[]) const char *file1, *file2; oflag = O_RDONLY; - while ((ch = getopt(argc, argv, "hlsxz")) != -1) + while ((ch = getopt_long(argc, argv, "+hlsxz", long_opts, NULL)) != -1) switch (ch) { case 'h': /* Don't follow symlinks */ oflag |= O_NOFOLLOW;