X-Git-Url: http://git.ieval.ro/?p=gruntmaster-data.git;a=blobdiff_plain;f=lib%2FGruntmaster%2FApp%2FCommand%2FShow.pm;h=e21578a6df4e409def2b6534f072b9d522be59fe;hp=0c06d573a92e3435a4012e34b35ed345745fce04;hb=dcf7f640534d6ad6d0273ac5b8bb1e9892fcaa56;hpb=92f74061ec24c7d45c9312ae54280356530f6c8c diff --git a/lib/Gruntmaster/App/Command/Show.pm b/lib/Gruntmaster/App/Command/Show.pm index 0c06d57..e21578a 100644 --- a/lib/Gruntmaster/App/Command/Show.pm +++ b/lib/Gruntmaster/App/Command/Show.pm @@ -28,14 +28,14 @@ sub validate_args { sub execute { my ($self, $opt, $args) = @_; my ($obj) = @$args; - $TABLE{$self->app->table}->(db->select($self->app->table, '*', {id => $obj})->kv_list); + $TABLE{$self->app->table}->(%{db->select($self->app->table, '*', {id => $obj})->hash}); } sub show_contest { my (%columns) = @_; $columns{$_} = strftime '%c', localtime $columns{$_} for qw/start stop/; - print < +Phone: $columns{phone} +Since: $columns{since} +Admin: @{[$columns{admin} ? 'Yes' : 'No']} +Level: $columns{level} +University: $columns{university} +Town: $columns{town} +Country: $columns{country} +END +} + 1; __END__ + +=encoding utf-8 + +=head1 NAME + +Gruntmaster::App::Command::Show - display human-readable information about an object + +=head1 SYNOPSIS + + gm -u show MGV + gm -p show aplusb + gm -c show test_ct + gm -j show 100 + +=head1 DESCRIPTION + +The get command takes an object ID and prints information about that +object in a human-readable format. + +=head1 SEE ALSO + +L + +=head1 AUTHOR + +Marius Gavrilescu, Emarius@ieval.roE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 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