my $stop = str2time prompt 'Stop time' or die 'Cannot parse time';
$db->contests->create({id => $id, name => $name, owner => $owner, start => $start, stop => $stop});
- purge '/ct/';
}
sub cmd_rm{
my ($id) = @_;
$db->contest(shift)->delete;
- purge '/ct/';
- purge "/ct/$id";
}
sub cmd_get{
sub cmd_set{
my ($id, %values) = @_;
$db->contest($id)->update(\%values);
- purge '/ct/';
- purge "/ct/$id";
}
##################################################
sub cmd_rm{
my ($id) = @_;
$db->job($id)->delete;
- purge '/log/';
- purge "/log/$id";
}
sub cmd_get{
sub cmd_set{
my ($id, %values) = @_;
$db->job($id)->update(\%values);
- purge '/log/';
- purge "/log/$id";
}
sub cmd_rerun{
my ($id) = @_;
$db->job($id)->rerun;
- purge '/log/';
- purge "/log/$id";
}
##################################################
$db->problems->create (\%options);
$db->contest_problems->create({problem => $id, contest => $contest}) if $contest;
- purge '/pb/';
}
sub cmd_set{
my ($id, %values) = @_;
%values = map { $_ => scalar read_file $values{$_} } keys %values if $file;
$db->problem($id)->update(\%values);
- purge '/pb/';
- purge "/pb/$id";
}
sub cmd_get{
sub cmd_rm{
my ($id) = @_;
$db->problem($id)->delete;
- purge '/pb/';
- purge "/pb/$id";
}
sub cmd_show{