Date: Fri, 8 Aug 2014 16:32:06 +0000 (UTC) From: Benjamin Kaduk <bjk@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269727 - head/usr.bin/vmstat Message-ID: <53e4fb86.2f07.7d153176@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bjk (doc committer) Date: Fri Aug 8 16:32:06 2014 New Revision: 269727 URL: http://svnweb.freebsd.org/changeset/base/269727 Log: Update vmstat usage for last-argument count/wait parameters Correct the usage in both the manpage and in usage() to indicate that the wait interval and repetition count may be given either with the respective -w/-c arguments, or as the final positional arguments. [0] The corresponding code to implement the positional arguments has been conditional on the (always-enabled) BACKWARD_COMPATIBILITY macro since the original 4.4-lite import. It's no longer reasonable to remove the functionality, so remove the macro and conditional instead. Note that multiple disks may be given on the command line. While here, sort arguments and apply minor mdoc fixes. PR: 184755 [0] Approved by: hrs (mentor, src committer) Modified: head/usr.bin/vmstat/vmstat.8 head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.8 ============================================================================== --- head/usr.bin/vmstat/vmstat.8 Fri Aug 8 15:50:02 2014 (r269726) +++ head/usr.bin/vmstat/vmstat.8 Fri Aug 8 16:32:06 2014 (r269727) @@ -28,7 +28,7 @@ .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd October 21, 2006 +.Dd August 8, 2014 .Dt VMSTAT 8 .Os .Sh NAME @@ -38,9 +38,8 @@ .Nm .\" .Op Fl fimst .Op Fl afHhimPsz -.Op Fl c Ar count .Op Fl M Ar core Op Fl N Ar system -.Op Fl w Ar wait +.Op Fl c Ar count .Op Fl n Ar devs .Oo .Fl p @@ -48,7 +47,9 @@ .Ar type , if , pass .Sm on .Oc -.Op Ar disks +.Op Fl w Ar wait +.Op Ar disks ... +.Op wait Op count .Sh DESCRIPTION The .Nm @@ -91,10 +92,12 @@ and system calls since system startup, and the number of pages of virtual memory involved in each. .It Fl h -Changes memory columns into more easily human readable form. Default if +Changes memory columns into more easily human readable form. +The default if standard output is a terminal device. .It Fl H -Changes memory columns into straight numbers. Default if standard output +Changes memory columns into straight numbers. +The default if standard output is not a terminal device (such as a script). .It Fl i Report on the number of interrupts taken by each device since system @@ -214,6 +217,21 @@ Report on memory used by the kernel zone by zone. .El .Pp +The +.Ar wait +and +.Ar count +arguments may be given after their respective flags at any point +on the command line before the +.Ar disks +argument(s), or without their flags, as the final argument(s). +The latter form is accepted for backwards compatibility, but it is +preferred to use the forms with +.Fl w +and +.Fl c +to avoid ambiguity. +.Pp By default, .Nm displays the following information: Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Aug 8 15:50:02 2014 (r269726) +++ head/usr.bin/vmstat/vmstat.c Fri Aug 8 16:32:06 2014 (r269727) @@ -299,15 +299,12 @@ retry_nlist: argv = getdrivedata(argv); } -#define BACKWARD_COMPATIBILITY -#ifdef BACKWARD_COMPATIBILITY if (*argv) { f = atof(*argv); interval = f * 1000; if (*++argv) reps = atoi(*argv); } -#endif if (interval) { if (!reps) @@ -1360,7 +1357,7 @@ static void usage(void) { (void)fprintf(stderr, "%s%s", - "usage: vmstat [-afHhimPsz] [-c count] [-M core [-N system]] [-w wait]\n", - " [-n devs] [-p type,if,pass] [disks]\n"); + "usage: vmstat [-afHhimPsz] [-M core [-N system]] [-c count] [-n devs]\n", + " [-p type,if,pass] [-w wait] [disks] [wait [count]]\n"); exit(1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53e4fb86.2f07.7d153176>