]>
Commit | Line | Data |
---|---|---|
92f74061 MG |
1 | package Gruntmaster::App::Command::Rerun; |
2 | ||
3 | use 5.014000; | |
4 | use warnings; | |
5 | ||
add75bf5 | 6 | our $VERSION = '5999.000_015'; |
92f74061 MG |
7 | |
8 | use Gruntmaster::App '-command'; | |
9 | use Gruntmaster::Data; | |
9baaf76b | 10 | use Scalar::Util qw/looks_like_number/; |
92f74061 | 11 | |
9baaf76b | 12 | sub usage_desc { '%c rerun id...' } |
92f74061 MG |
13 | |
14 | sub validate_args { | |
15 | my ($self, $opt, $args) = @_; | |
16 | my @args = @$args; | |
9baaf76b | 17 | $self->usage_error('Not enough arguments') if @args < 1; |
92f74061 MG |
18 | } |
19 | ||
20 | sub execute { | |
21 | my ($self, $opt, $args) = @_; | |
9baaf76b S |
22 | my @args = @$args; |
23 | ||
24 | for my $obj (@args) { | |
25 | if (looks_like_number $obj) { | |
26 | rerun_job $obj; | |
27 | } | |
28 | else { | |
29 | rerun_problem $obj; | |
30 | } | |
31 | } | |
92f74061 MG |
32 | } |
33 | ||
34 | 1; | |
35 | __END__ | |
63afa40a MG |
36 | |
37 | =encoding utf-8 | |
38 | ||
39 | =head1 NAME | |
40 | ||
9baaf76b | 41 | Gruntmaster::App::Command::Rerun - rerun some jobs and probles |
63afa40a MG |
42 | |
43 | =head1 SYNOPSIS | |
44 | ||
9baaf76b S |
45 | gm rerun 123 124 |
46 | ||
47 | gm rerun aplusb aminusb | |
48 | ||
49 | gm rerun 12 aplusb | |
63afa40a MG |
50 | |
51 | =head1 DESCRIPTION | |
52 | ||
9baaf76b | 53 | The rerun command takes some IDs of jobs and problems and reruns them. |
63afa40a MG |
54 | |
55 | =head1 SEE ALSO | |
56 | ||
57 | L<gm> | |
58 | ||
59 | =head1 AUTHOR | |
60 | ||
61 | Marius Gavrilescu, E<lt>marius@ieval.roE<gt> | |
62 | ||
63 | =head1 COPYRIGHT AND LICENSE | |
64 | ||
e1b9f3dd | 65 | Copyright (C) 2014-2015 by Marius Gavrilescu |
63afa40a MG |
66 | |
67 | This library is free software; you can redistribute it and/or modify | |
68 | it under the same terms as Perl itself, either Perl version 5.20.1 or, | |
69 | at your option, any later version of Perl 5 you may have available. | |
70 | ||
71 | ||
72 | =cut |