diff options
author | Eitan Adler <eadler@FreeBSD.org> | 2014-04-07 02:31:10 +0000 |
---|---|---|
committer | Eitan Adler <eadler@FreeBSD.org> | 2014-04-07 02:31:10 +0000 |
commit | 6d12a834080a3178b6d3b847f784364268e73c1f (patch) | |
tree | 124e4010cde0cb9165802edc6b89299874a1b5c5 /usr.bin | |
parent | b4b139b109c353cc6503e60f29f3801b8594f371 (diff) | |
download | src-6d12a834080a3178b6d3b847f784364268e73c1f.tar.gz src-6d12a834080a3178b6d3b847f784364268e73c1f.zip |
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
Notes
Notes:
svn path=/head/; revision=264216
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/units/units.1 | 6 | ||||
-rw-r--r-- | usr.bin/units/units.c | 12 |
2 files changed, 7 insertions, 11 deletions
diff --git a/usr.bin/units/units.1 b/usr.bin/units/units.1 index a7371c1889ea..2ce10002dc93 100644 --- a/usr.bin/units/units.1 +++ b/usr.bin/units/units.1 @@ -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 to load. .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. diff --git a/usr.bin/units/units.c b/usr.bin/units/units.c index b1a04f71a0d4..2a099ce3a761 100644 --- a/usr.bin/units/units.c +++ b/usr.bin/units/units.c @@ -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; } } |