#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use WebCoso::Common;

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,
                   'clean'=>\$CLEAN,
               );
exit 1 unless $res;
$WebCoso::Common::SRCPATH=~s{/+$}{};
$WebCoso::Common::DSTPATH=~s{/+$}{};
$WebCoso::Common::DSTBASEURL=~s{/*$}{/};
}

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