Home | History | Annotate | Line # | Download | only in scripts
plot_summary-opts revision 1.1.1.12
      1 # EDIT THIS FILE WITH CAUTION  (plot_summary-opts)
      2 #
      3 # It has been AutoGen-ed  August 14, 2018 at 08:09:38 AM by AutoGen 5.18.5
      4 # From the definitions    plot_summary-opts.def
      5 # and the template file   perlopt
      6 
      7 use Getopt::Long qw(GetOptionsFromArray);
      8 Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
      9 
     10 my $usage;
     11 
     12 sub usage {
     13     my ($ret) = @_;
     14     print STDERR $usage;
     15     exit $ret;
     16 }
     17 
     18 sub paged_usage {
     19     my ($ret) = @_;
     20     my $pager = $ENV{PAGER} || '(less || more)';
     21 
     22     open STDOUT, "| $pager" or die "Can't fork a pager: $!";
     23     print $usage;
     24 
     25     exit $ret;
     26 }
     27 
     28 sub processOptions {
     29     my $args = shift;
     30 
     31     my $opts = {
     32         'directory' => '/tmp',
     33         'identifier' => '',
     34         'offset-limit' => '0.128',
     35         'peer' => [],
     36         'plot-term' => '',
     37         'output-file' => '',
     38         'dont-wait' => '',
     39         'help' => '', 'more-help' => ''
     40     };
     41     my $argument = '';
     42     my $ret = GetOptionsFromArray($args, $opts, (
     43         'directory=s', 'identifier=s', 'offset-limit=f',
     44         'peer=s', 'plot-term=s', 'output-file=s',
     45         'dont-wait',
     46         'help|?', 'more-help'));
     47 
     48     $usage = <<'USAGE';
     49 plot_summary - plot statistics generated by summary script - Ver. 4.2.8p12
     50 USAGE: plot_summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 
     51 
     52         --directory=str          Where the summary files are
     53         --identifier=str         Origin of the data
     54         --offset-limit=float     Limit of absolute offset
     55         --peer=str               Peers to generate plots for
     56                                    - may appear multiple times
     57         --plot-term=str          Gnuplot terminal
     58         --output-file=str        Output file
     59         --dont-wait              Don't wait for keystroke between plots
     60     -?, --help                   Display usage information and exit
     61         --more-help              Pass the extended usage text through a pager
     62 
     63 Options are specified by doubled hyphens and their name or by a single
     64 hyphen and the flag character.
     65 USAGE
     66 
     67     usage(0)       if $opts->{'help'};
     68     paged_usage(0) if $opts->{'more-help'};
     69     $_[0] = $opts;
     70     return $ret;
     71 }
     72 
     73 END { close STDOUT };
     74