X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;ds=sidebyside;f=lib%2FGruntmaster%2FApp%2FCommand%2FAdd.pm;h=8f84dc3dbbeea559815ff92a7f363262fe5966c8;hb=e1b6fd19f5724ce68ee92aaeae1c0ddf7a6a2561;hp=b161904f620085bf2daeadc182d42e276c318cd2;hpb=8bb80034f59b3370ce0940d48d0e418dd8e18993;p=gruntmaster-data.git diff --git a/lib/Gruntmaster/App/Command/Add.pm b/lib/Gruntmaster/App/Command/Add.pm index b161904..8f84dc3 100644 --- a/lib/Gruntmaster/App/Command/Add.pm +++ b/lib/Gruntmaster/App/Command/Add.pm @@ -3,7 +3,7 @@ package Gruntmaster::App::Command::Add; use 5.014000; use warnings; -our $VERSION = '5999.000_004'; +our $VERSION = '5999.000_014'; use Gruntmaster::App '-command'; use Gruntmaster::Data; @@ -48,8 +48,8 @@ sub add_contest { my $name = prompt 'Contest name'; my $owner = prompt 'Owner'; - my $start = str2time prompt 'Start time' or die 'Cannot parse time'; - my $stop = str2time prompt 'Stop time' or die 'Cannot parse time'; + my $start = str2time prompt 'Start time' or die "Cannot parse time\n"; + my $stop = str2time prompt 'Stop time' or die "Cannot parse time\n"; db->insert(contests => {id => $id, name => $name, owner => $owner, start => $start, stop => $stop}); } @@ -122,3 +122,39 @@ sub add_problem { 1; __END__ + +=encoding utf-8 + +=head1 NAME + +Gruntmaster::App::Command::Add - add a problem or contest by answering a series of prompts + +=head1 SYNOPSIS + + gm -p add aplusb + gm -c add test_contest + +=head1 DESCRIPTION + +The add command creates a new problem or contest by prompting the user +for the properties of the new object. It takes a single argument, the +ID of the new object. + +=head1 SEE ALSO + +L + +=head1 AUTHOR + +Marius Gavrilescu, Emarius@ieval.roE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2014-2015 by Marius Gavrilescu + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.20.1 or, +at your option, any later version of Perl 5 you may have available. + + +=cut