svn commit: r189274 - head/tools/tools/ath/athstats
Sam Leffler
sam at FreeBSD.org
Sun Mar 1 21:07:07 PST 2009
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) {
More information about the svn-src-all
mailing list