#!/afs/athena/contrib/perl/perl
#

sub usage { print "Bzzzzzzzzzt.  Wrong.\n"; }

while ($ARGV[0] =~ /^-/) {
    ($ARGV[0] =~ /^-d(e(b(ug?)?)?)?$/)
	&& (shift @ARGV, $debug++, next);
    ($ARGV[0] =~ /^-v(e(r(b(o(se?)?)?)?)?)?$/)
	&& (shift @ARGV, $verbose++, next);
    ($ARGV[0] =~ /^-n(o(op?)?)?$/)
	&& (shift @ARGV, $dontdoit++, next);    

    ($ARGV[0] =~ /^-b(a(c(k(u(p(b(y(n(a(me?)?)?)?)?)?)?)?)?)?)?$/)
	&& (shift @ARGV, $autobackup++, next);
    ($ARGV[0] =~ /^-o/)
	&& (shift @ARGV, $keepro++, next);
    ($ARGV[0] =~ /^-r/)
	&& (shift @ARGV, $norelease++, next);
    &usage();
}

$shost = shift(@ARGV) || &usage();
if ($shost =~ /^(\S+)\.(.)$/) {
    ($shost,$spart) = ($1,$2);
}

$dhost = shift(@ARGV) || &usage();
if ($dhost =~ /^(\S+)\.(.)$/) {
    ($dhost,$dpart) = ($1,$2);
} else { &usage(); }

if ($cell = shift(@ARGV)) {
    $cell = "-cell $cell";
}

$logfile = shift(@ARGV) || ($DEFlogfile . $$);

@ARGV && &usage();
