From owner-svn-src-head@FreeBSD.ORG Mon May 12 06:14:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAAFA2F2; Mon, 12 May 2014 06:14:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C83D72D1A; Mon, 12 May 2014 06:14:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C6EE0m040878; Mon, 12 May 2014 06:14:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C6EE7R040877; Mon, 12 May 2014 06:14:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405120614.s4C6EE7R040877@svn.freebsd.org> From: Eitan Adler Date: Mon, 12 May 2014 06:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265904 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 06:14:14 -0000 Author: eadler Date: Mon May 12 06:14:14 2014 New Revision: 265904 URL: http://svnweb.freebsd.org/changeset/base/265904 Log: units(1): unbreak -f option, fix some style, increase compatibility. - Unbreak the -f option: it was missing a ':' - gunits -V spits out more information than just its version: attempt to do so as well. Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon May 12 05:44:55 2014 (r265903) +++ head/usr.bin/units/units.c Mon May 12 06:14:14 2014 (r265904) @@ -80,7 +80,6 @@ static bool verbose = false; static const char * havestr; static const char * wantstr; - static int addsubunit(char *product[], char *toadd); static int addunit(struct unittype *theunit, const char *toadd, int flip, int quantity); static void cancelunit(struct unittype * theunit); @@ -719,7 +718,7 @@ main(int argc, char **argv) quiet = false; readfile = false; - while ((optchar = getopt(argc, argv, "fqvUV:")) != -1) { + while ((optchar = getopt(argc, argv, "f:qvUV")) != -1) { switch (optchar) { case 'f': readfile = true; @@ -734,6 +733,9 @@ main(int argc, char **argv) case 'v': verbose = true; break; + case 'V': + fprintf(stderr, "FreeBSD units\n"); + /* FALLTHROUGH */ case 'U': if (access(UNITSFILE, F_OK) == 0) printf("%s\n", UNITSFILE); @@ -741,10 +743,6 @@ main(int argc, char **argv) printf("Units data file not found"); exit(0); break; - case 'V': - fprintf(stderr, "FreeBSD units\n"); - usage(); - break; default: usage(); }