#! /usr/bin/perl
$bindir        = "/users/jonh/BSP/bin";
$includedir    = "/users/jonh/BSP/include";
$libdir        = "/users/jonh/BSP/lib";
$mandir        = "/users/jonh/BSP/man";






















push(@INC,$includedir);
push(@INC,$bindir);
require "bsputil";

select(STDERR); $| = 1; select(STDOUT); # no STDERR buffering, please.
($Pgm = $0) =~ s|.*/||;
$Version        = "1.3, 25th Nov 1997";
$bug_reports_to = 'bsplib-bugs@comlab.ox.ac.uk';

$ShortUsage = "\n$Pgm usage: for basic information, try the `-help' option\n";



$Verbose        = 0;
$Arch           = &backtick("$bindir/bsparch -arch");
$Arch           = &backtick("bsparch -arch")  if ($Arch eq "");
$RefreshRate    = 0;




  arg: while ($_ = $ARGV[0]) {
  shift(@ARGV);
  #--------HELP------------------------------------------------
  /^-(help|man)$/     && do {&FormatManual("bspkstats.1");exit(0);};

  /^-v$/              && do {$Verbose = 1; next arg;};

  /^-r$/              && do {$RefreshRate = &grab_next_arg("-r");
			     if (!($RefreshRate =~ /^\d+$/)) {
			       printf STDERR "%s: invalid refresh \"%s\"\n",
					     $Pgm,$RefreshRate;
			       $Status++;
			     }
			     next arg;
			     };		

  print STDERR "Unrecognised option \"",$_,"\"\n";
  $Status++;
  }
  if ($Status>0) {
    print STDERR $ShortUsage;
    exit(1);
  }
  print STDERR "$Pgm: ($Version)\n" if $Verbose;
  $runcmd  = "$bindir/$Arch/bspkstats ";
  $runcmd .= "r$RefreshRate " if $RefreshRate>0;
  &run_something($runcmd,"Stats for 3Com 3C905B kernel module");
  exit(0);

