#!/usr/bin/perl
#

use strict;

use Getopt::Std;
use File::Basename;

use lib '/app/tools/common/lib';
use Common::News::UpdateFeed;

my %opt;
usage() unless getopts( 'hqvdr:x:', \%opt );

if ( $opt{h} ) {
    usage();
}

my $controller = new Common::News::UpdateFeed(
    product      => 'bookpub',
    report_email => $opt{r},
    error_email  => $opt{x},
    quiet        => $opt{q},
    verbose      => $opt{v},
    debug        => $opt{d}
);

$controller->run();

sub usage {
    my $prog = basename $0;

    print <<EofUSAGE;

usage: $prog -p type [-r email] [-x email] [-h] [-d] [-v] [-q]
            -p - product (i.e. bookpub or rps)
            -r - Send summary report to this email instead of STDOUT
            -x - Send error report to this email instead of STDERR
            -d - display debug information to STDERR
            -v - display verbose debug information to STDERR
            -q - Do not output summary report
            -h - display this screen
EofUSAGE

    exit 1;
}

1;
