summaryrefslogtreecommitdiffstats
path: root/usr.sbin/gstat
diff options
context:
space:
mode:
authorkeramida <keramida@FreeBSD.org>2003-03-22 09:39:52 +0000
committerkeramida <keramida@FreeBSD.org>2003-03-22 09:39:52 +0000
commit7dbdb2c2f17774893f662189d9ec5bf452d5876b (patch)
tree86282ac426c4058589a554fc0d74e3bffa8611c3 /usr.sbin/gstat
parent63a7e8cbbbbd60eff3c1c67d0a7ae8b2203cf92f (diff)
downloadFreeBSD-src-7dbdb2c2f17774893f662189d9ec5bf452d5876b.zip
FreeBSD-src-7dbdb2c2f17774893f662189d9ec5bf452d5876b.tar.gz
Add & use a usage() function.
Diffstat (limited to 'usr.sbin/gstat')
-rw-r--r--usr.sbin/gstat/gstat.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.sbin/gstat/gstat.c b/usr.sbin/gstat/gstat.c
index 8242935..dea5453 100644
--- a/usr.sbin/gstat/gstat.c
+++ b/usr.sbin/gstat/gstat.c
@@ -50,6 +50,8 @@
static int flag_c;
static int flag_I = 500000;
+static void usage(void);
+
int
main(int argc, char **argv)
{
@@ -88,13 +90,13 @@ main(int argc, char **argv)
break;
case '?':
default:
- errx(1, "Usage!");
+ usage();
}
}
argc -= optind;
argv += optind;
if (argc != 0)
- errx(1, "Usage!");
+ usage();
i = geom_gettree(&gmp);
if (i != 0)
@@ -233,3 +235,11 @@ main(int argc, char **argv)
endwin();
exit (0);
}
+
+static void
+usage(void)
+{
+ fprintf(stderr, "usage: gstat [-c] [-I interval]\n");
+ exit(1);
+ /* NOTREACHED */
+}
OpenPOWER on IntegriCloud