#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use WebCoso::Common;
use Log::Log4perl ':easy';

my $CLEAN=0;

{
my $res=GetOptions('src|s=s'=>\$WebCoso::Common::SRCPATH,
                   'dst|d=s'=>\$WebCoso::Common::DSTPATH,
                   'url|u=s'=>\$WebCoso::Common::DSTBASEURL,
                   'include|I=s'=>\@WebCoso::Common::TMPLPATH,
                   'verbose|v+'=>\$WebCoso::Common::VERBOSITY,
                   'clean'=>\$CLEAN,
               );
exit 1 unless $res;
$WebCoso::Common::SRCPATH=~s{/+$}{};
$WebCoso::Common::DSTPATH=~s{/+$}{};
$WebCoso::Common::DSTBASEURL=~s{/*$}{/};
}
Log::Log4perl->easy_init({level=>$WebCoso::Common::VERBOSITY});


if ($CLEAN) {
    require WebCoso::Cleaner;
    WebCoso::Cleaner::clean();
}
else {
    require WebCoso::Maker;
    WebCoso::Maker::make();
}
