# -*-perl-*-

# $Id: cricket.plm,v 1.2 2005/02/21 20:56:31 thomas Exp $

# Generate cricket configuration(s) from an existing system

# $Log: cricket.plm,v $
# Revision 1.2  2005/02/21 20:56:31  thomas
# Help out the stinking pile known as help
#
# Revision 1.1  2005/02/08 16:41:25  thomas
# cli access to rebuild cricket config files
#


=head1 NAME

What::Command::cricket -- Create cricket configurations from what data

=head1 SYNOPSIS

what cricket

=head1 DESCRIPTION

Create/update cricket configuration files from the cricket data in the
B</Data/Monitor/Cricket/> section of the global B<what> configuration
data.

=cut

package What::Command::cricket;

use strict;
use Getopt::Long;
use Sys::Hostname;
use What::Cricket;

use base qw(What::Command);

our $helpmsg = "Create cricket configurations from what data";

###############################################################################

sub main {
  my $self = shift;
  my $what = shift;
  local (@ARGV) = @_;

  my ($res, $help, $me) = (0, 0, 0);
  Getopt::Long::Configure ("bundling");
  if (!($res = GetOptions (
                           'help|h',   \$help,
                          ))) {
    $what->err ("Bad option passed to cricket command!\n");
    return 0;
  }

  $help and return $self->help();

  What::Cricket->generate_cricket($what);
}

###############################################################################

1;
