]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/App/Command/Rerun.pm
Replace gruntmaster-* scripts with App::Cmd-based gm
[gruntmaster-data.git] / lib / Gruntmaster / App / Command / Rerun.pm
diff --git a/lib/Gruntmaster/App/Command/Rerun.pm b/lib/Gruntmaster/App/Command/Rerun.pm
new file mode 100644 (file)
index 0000000..b5e98a8
--- /dev/null
@@ -0,0 +1,27 @@
+package Gruntmaster::App::Command::Rerun;
+
+use 5.014000;
+use warnings;
+
+our $VERSION = '5999.000_004';
+
+use Gruntmaster::App '-command';
+use Gruntmaster::Data;
+
+sub usage_desc { '%c rerun id' }
+
+sub validate_args {
+       my ($self, $opt, $args) = @_;
+       my @args = @$args;
+       $self->usage_error('This command only works on jobs') if $self->app->table && $self->app->table ne 'jobs';
+       $self->usage_error('Wrong number of arguments') if @args != 1;
+}
+
+sub execute {
+       my ($self, $opt, $args) = @_;
+       my ($obj) = @$args;
+       db->rerun_job($obj);
+}
+
+1;
+__END__
This page took 0.022891 seconds and 4 git commands to generate.