From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 02:31:10 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 E2E8B2C7; Mon, 7 Apr 2014 02:31:10 +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 B5E34AF4; Mon, 7 Apr 2014 02:31:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s372VAMO080279; Mon, 7 Apr 2014 02:31:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s372VAW8080275; Mon, 7 Apr 2014 02:31:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404070231.s372VAW8080275@svn.freebsd.org> From: Eitan Adler Date: Mon, 7 Apr 2014 02:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264216 - 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.17 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, 07 Apr 2014 02:31:11 -0000 Author: eadler Date: Mon Apr 7 02:31:10 2014 New Revision: 264216 URL: http://svnweb.freebsd.org/changeset/base/264216 Log: units(1): make -V print version instead of -v The units program is likely little used. It is even less likely that a script will want the units program to print out its version number by passing -v. GNU units uses -V for version and -v for verbosity. Increase compatibility between these two versions (written by the same author) by switching our flag as well. Take this opportunity to remove bogus information about the version number and just call it 'FreeBSD units'. Discussed with: cperciva, rwatson Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Mon Apr 7 01:57:51 2014 (r264215) +++ head/usr.bin/units/units.1 Mon Apr 7 02:31:10 2014 (r264216) @@ -8,7 +8,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar filename -.Op Fl qv +.Op Fl qV .Op Ar from-unit to-unit .Sh OPTIONS The following options are available: @@ -18,8 +18,8 @@ Specify the name of the units data file .It Fl q Suppress prompting of the user for units and the display of statistics about the number of units loaded. -.It Fl v -Print the version number. +.It Fl V +Print the version number, usage, and then exit. .It Ar from-unit to-unit Allow a single unit conversion to be done directly from the command line. Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 7 01:57:51 2014 (r264215) +++ head/usr.bin/units/units.c Mon Apr 7 02:31:10 2014 (r264216) @@ -32,8 +32,6 @@ static const char rcsid[] = #include "pathnames.h" -#define VERSION "1.0" - #ifndef UNITSFILE #define UNITSFILE _PATH_UNITSLIB #endif @@ -689,7 +687,7 @@ main(int argc, char **argv) char *userfile = 0; int quiet = 0; - while ((optchar = getopt(argc, argv, "vqf:")) != -1) { + while ((optchar = getopt(argc, argv, "Vqf:")) != -1) { switch (optchar) { case 'f': userfile = optarg; @@ -697,14 +695,12 @@ main(int argc, char **argv) case 'q': quiet = 1; break; - case 'v': - fprintf(stderr, "\n units version %s Copyright (c) 1993 by Adrian Mariano\n", - VERSION); - fprintf(stderr, " This program may be freely distributed\n"); + case 'V': + fprintf(stderr, "FreeBSD units\n"); usage(); + break; default: usage(); - break; } }