Date: Mon, 2 Mar 2009 05:07:05 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r189274 - head/tools/tools/ath/athstats Message-ID: <200903020507.n22575fI065886@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Mon Mar 2 05:07:05 2009 New Revision: 189274 URL: http://svn.freebsd.org/changeset/base/189274 Log: add -b option to suppress the banner Modified: head/tools/tools/ath/athstats/main.c Modified: head/tools/tools/ath/athstats/main.c ============================================================================== --- head/tools/tools/ath/athstats/main.c Mon Mar 2 04:35:52 2009 (r189273) +++ head/tools/tools/ath/athstats/main.c Mon Mar 2 05:07:05 2009 (r189274) @@ -33,7 +33,7 @@ * Simple Atheros-specific tool to inspect and monitor network traffic * statistics. * - * athstats [-i interface] [-z] [-l] [-o fmtstring] [interval] + * athstats [-i interface] [-bz] [-l] [-o fmtstring] [interval] * * (default interface is ath0). If interval is specified a rolling output * a la netstat -i is displayed every interval seconds. The format of @@ -89,14 +89,17 @@ main(int argc, char *argv[]) { struct athstatfoo *wf; const char *ifname; - int c; + int c, banner = 1; ifname = getenv("ATH"); if (ifname == NULL) ifname = "ath0"; wf = athstats_new(ifname, getfmt("default")); - while ((c = getopt(argc, argv, "i:lo:z")) != -1) { + while ((c = getopt(argc, argv, "bi:lo:z")) != -1) { switch (c) { + case 'b': + banner = 0; + break; case 'i': wf->setifname(wf, optarg); break; @@ -127,7 +130,8 @@ main(int argc, char *argv[]) signalled = 0; alarm(interval); banner: - wf->print_header(wf, stdout); + if (banner) + wf->print_header(wf, stdout); line = 0; loop: if (line != 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903020507.n22575fI065886>