diff options
author | eadler <eadler@FreeBSD.org> | 2014-05-12 06:14:14 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2014-05-12 06:14:14 +0000 |
commit | 55915918c76653146970406cab03886876cf5ea5 (patch) | |
tree | 767155d0bd6975b08f6f4fd055daeb61ec53b518 /usr.bin | |
parent | 6ef45d7151a097124bb96513ed7b125cf963782d (diff) | |
download | FreeBSD-src-55915918c76653146970406cab03886876cf5ea5.zip FreeBSD-src-55915918c76653146970406cab03886876cf5ea5.tar.gz |
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.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/units/units.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/units/units.c b/usr.bin/units/units.c index 4691036..c913f7c 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(); } |