#!/usr/bin/env perl

use strict;
use warnings;

use MYDan::Multicast;
use MYDan::Util::OptConf;

$| ++;

=head1 SYNOPSIS

 $0 --recv 127.0.0.1:2000 --repo /data/path \
    [--iface] eth0 [--verbose]

=cut

my $option = MYDan::Util::OptConf->load();
my %o = $option->get( qw( recv=s repo=s iface=s verbose ) )->dump();

$option->assert( qw( recv repo ) );

$MYDan::Multicast::VERBOSE = $o{verbose};

MYDan::Multicast->new( map{ $_ => $o{$_} }qw( recv iface ) )
    ->recv( $o{repo} );

