Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 May 2014 06:14:14 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265904 - head/usr.bin/units
Message-ID:  <201405120614.s4C6EE7R040877@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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();
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405120614.s4C6EE7R040877>