]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/App/Command/List.pm
Replace gruntmaster-* scripts with App::Cmd-based gm
[gruntmaster-data.git] / lib / Gruntmaster / App / Command / List.pm
diff --git a/lib/Gruntmaster/App/Command/List.pm b/lib/Gruntmaster/App/Command/List.pm
new file mode 100644 (file)
index 0000000..3c62604
--- /dev/null
@@ -0,0 +1,25 @@
+package Gruntmaster::App::Command::List;
+
+use 5.014000;
+use warnings;
+
+our $VERSION = '5999.000_004';
+
+use Gruntmaster::App '-command';
+use Gruntmaster::Data;
+
+sub usage_desc { '%c [-cjpu] list' }
+
+sub validate_args {
+       my ($self, $opt, $args) = @_;
+       my @args = @$args;
+       $self->usage_error('No table selected') unless $self->app->table;
+}
+
+sub execute {
+       my ($self, $opt, $args) = @_;
+       say join "\n", db->select($self->app->table, 'id', {}, 'id')->flat
+}
+
+1;
+__END__
This page took 0.017598 seconds and 4 git commands to generate.