summaryrefslogtreecommitdiff
path: root/usr.bin/systat/main.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-08-08 20:07:50 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-08-08 20:07:50 +0000
commit906c90134dd7e6b743bda0f25ec05593ff4068d4 (patch)
tree9db33e3d1bc472d1d8a695031ac6828992daa206 /usr.bin/systat/main.c
parentaf52a2ae52d03852b1541f5f5394460f0be78aff (diff)
Small step towards fixing documentation:
- sync usage() with reality. Remove the -h option that does nothing. - don't complain about kvm_openfiles() error in case of incorrect usage. - add basic descriptions of the new options and views in the manual page. More is needed... with help from jmc@ and sobrado@. ok sobrado@.
Diffstat (limited to 'usr.bin/systat/main.c')
-rw-r--r--usr.bin/systat/main.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 28ebe0de07d..7d81009c51e 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.42 2008/07/31 04:24:11 canacar Exp $ */
+/* $Id: main.c,v 1.43 2008/08/08 20:07:49 matthieu Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -208,8 +208,8 @@ void
usage()
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-abhir] [-c cache] [-d cnt]", __progname);
- fprintf(stderr, " [-o field] [-s time] [-w width] [view] [num]\n");
+ fprintf(stderr, "usage: %s [-abin] [-d count] [-S start] "
+ "[-s delay] [-w width] [view] [delay]\n", __progname);
exit(1);
}
@@ -409,14 +409,12 @@ main(int argc, char *argv[])
}
kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
- if (kd == NULL)
- warnx("kvm_openfiles: %s", errbuf);
gid = getgid();
if (setresgid(gid, gid, gid) == -1)
err(1, "setresgid");
- while ((ch = getopt(argc, argv, "abd:hins:S:w:")) != -1) {
+ while ((ch = getopt(argc, argv, "abd:ins:S:w:")) != -1) {
switch (ch) {
case 'a':
maxlines = -1;
@@ -453,14 +451,15 @@ main(int argc, char *argv[])
if (rawwidth >= MAX_LINE_BUF)
rawwidth = MAX_LINE_BUF - 1;
break;
- case 'h':
- /* FALLTHROUGH */
default:
usage();
/* NOTREACHED */
}
}
+ if (kd == NULL)
+ warnx("kvm_openfiles: %s", errbuf);
+
argc -= optind;
argv += optind;