Do not crash in t/tools.t if postgres is not running
[gruntmaster-data.git] / lib / Gruntmaster / App.pm
CommitLineData
92f74061
MG
1package Gruntmaster::App;
2
3use 5.014000;
4use warnings;
5
e1b6fd19 6our $VERSION = '5999.000_014';
92f74061
MG
7
8use App::Cmd::Setup '-app';
9use Gruntmaster::Data;
10
11sub allow_any_unambiguous_abbrev () { 1 }
12sub default_command { 'commands' } # Show usage when called without arguments
13
14sub global_opt_spec {
15 (['table' => 'hidden', {one_of => [
16 ['contests|ct|c' => 'Act on contests'],
17 ['jobs|j' => 'Act on jobs'],
18 ['problems|pb|p' => 'Act on problems'],
19 ['users|us|u' => 'Act on users']]}])
20}
21
22sub table { shift->global_options->{table} }
23
13af733e
MG
24sub run {
25 dbinit $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:';
26 shift->SUPER::run(@_);
27}
92f74061
MG
28
291;
30__END__
31
32=encoding utf-8
33
34=head1 NAME
35
36Gruntmaster::App - command-line interface to the Gruntmaster 6000 database
37
38=head1 SYNOPSIS
39
63afa40a
MG
40 use Gruntmaster::App;
41 Gruntmaster::App->run;
92f74061
MG
42
43=head1 DESCRIPTION
44
63afa40a
MG
45Gruntmaster::App is a command-line interface to the Gruntmaster 6000
46database. It is the backend of the B<gm> script.
47
48=head1 SEE ALSO
49
50L<gm>
51
52=head1 AUTHOR
53
54Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
55
56=head1 COPYRIGHT AND LICENSE
57
e1b9f3dd 58Copyright (C) 2014-2015 by Marius Gavrilescu
63afa40a
MG
59
60This library is free software; you can redistribute it and/or modify
61it under the same terms as Perl itself, either Perl version 5.20.1 or,
62at your option, any later version of Perl 5 you may have available.
92f74061
MG
63
64
65=cut
This page took 0.013898 seconds and 4 git commands to generate.