aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2014-05-12 06:14:14 +0000
committerEitan Adler <eadler@FreeBSD.org>2014-05-12 06:14:14 +0000
commitdb9def8b0ac5022e6ef0369d188a56be822e0221 (patch)
tree767155d0bd6975b08f6f4fd055daeb61ec53b518
parentcfa8c236403a97333a65f028d8cb0761ba068b9f (diff)
downloadsrc-db9def8b0ac5022e6ef0369d188a56be822e0221.tar.gz
src-db9def8b0ac5022e6ef0369d188a56be822e0221.zip
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.
Notes
Notes: svn path=/head/; revision=265904
-rw-r--r--usr.bin/units/units.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/units/units.c b/usr.bin/units/units.c
index 46910367e682..c913f7cc1d82 100644
--- a/usr.bin/units/units.c
+++ b/usr.bin/units/units.c
@@ -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();
}