=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/systat/main.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- src/usr.bin/systat/main.c 2019/10/14 19:22:17 1.71 +++ src/usr.bin/systat/main.c 2020/01/12 20:51:08 1.72 @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.71 2019/10/14 19:22:17 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.72 2020/01/12 20:51:08 martijn Exp $ */ /* * Copyright (c) 2001, 2007 Can Erkin Acar * Copyright (c) 2001 Daniel Hartmeier @@ -212,7 +212,7 @@ usage(void) { extern char *__progname; - fprintf(stderr, "usage: %s [-aBbiNn] [-d count] " + fprintf(stderr, "usage: %s [-aBbhiNn] [-d count] " "[-s delay] [-w width] [view] [delay]\n", __progname); exit(1); } @@ -305,6 +305,10 @@ need_update = 1; return; } + if (strncasecmp(buf, "human", 5) == 0) { + humanreadable = !humanreadable; + return; + } for (s = buf; *s && strchr("0123456789+-.eE", *s) != NULL; s++) ; @@ -438,7 +442,7 @@ if (setresgid(gid, gid, gid) == -1) err(1, "setresgid"); - while ((ch = getopt(argc, argv, "BNabd:ins:w:")) != -1) { + while ((ch = getopt(argc, argv, "BNabd:hins:w:")) != -1) { switch (ch) { case 'a': maxlines = -1; @@ -456,6 +460,9 @@ countmax = strtonum(optarg, 1, INT_MAX, &errstr); if (errstr) errx(1, "-d %s: %s", optarg, errstr); + break; + case 'h': + humanreadable = 1; break; case 'i': interactive = 1;