Write POD for Gruntmaster::App::*
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 2 Oct 2015 18:26:36 +0000 (21:26 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 2 Oct 2015 18:35:17 +0000 (21:35 +0300)
MANIFEST
lib/Gruntmaster/App.pm
lib/Gruntmaster/App/Command.pm [new file with mode: 0644]
lib/Gruntmaster/App/Command/Add.pm
lib/Gruntmaster/App/Command/Get.pm
lib/Gruntmaster/App/Command/List.pm
lib/Gruntmaster/App/Command/Rerun.pm
lib/Gruntmaster/App/Command/Rm.pm
lib/Gruntmaster/App/Command/Set.pm
lib/Gruntmaster/App/Command/Show.pm

index 6a285eb7668df3ef44f387aa6c657c2cdd3aefe8..7b03592f43afdd79b7558b3842c799e28d3694c2 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3,6 +3,7 @@ db.sql
 gm
 gruntmaster-opener
 lib/Gruntmaster/App.pm
+lib/Gruntmaster/App/Command.pm
 lib/Gruntmaster/App/Command/Add.pm
 lib/Gruntmaster/App/Command/Get.pm
 lib/Gruntmaster/App/Command/List.pm
index f2069284c6b5f53738540a3bdefdb14629be06cf..b87cf175ba471b3df10a11aa5679ad46015a4ca5 100644 (file)
@@ -34,10 +34,29 @@ Gruntmaster::App - command-line interface to the Gruntmaster 6000 database
 
 =head1 SYNOPSIS
 
-
+  use Gruntmaster::App;
+  Gruntmaster::App->run;
 
 =head1 DESCRIPTION
 
+Gruntmaster::App is a command-line interface to the Gruntmaster 6000
+database. It is the backend of the B<gm> script.
+
+=head1 SEE ALSO
+
+L<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
diff --git a/lib/Gruntmaster/App/Command.pm b/lib/Gruntmaster/App/Command.pm
new file mode 100644 (file)
index 0000000..b1be168
--- /dev/null
@@ -0,0 +1,61 @@
+package Gruntmaster::App::Command;
+
+use 5.014000;
+use strict;
+use warnings;
+
+our $VERSION = '5999.000_004';
+
+use parent qw/App::Cmd::Command/;
+use Pod::Usage;
+
+sub description {
+       my ($self) = @_;
+       my ($file) = (ref $self) =~ s,::,/,gr;
+       my $usage;
+       open my $fh, '>', \$usage;
+       pod2usage(-input => $INC{"$file.pm"}, -output => $fh, -exitval => 'NOEXIT', -verbose => 99, -sections => [qw/SYNOPSIS DESCRIPTION/]);
+       close $fh;
+       $usage =~ s/Usage:/Usage examples:/;
+       1 while chomp $usage;
+       $usage
+}
+
+1;
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::App::Command - Base class for gm commands
+
+=head1 SYNOPSIS
+
+  package Gruntmaster::App::Command::foo;
+  use Gruntmaster::App '-command';
+
+=head1 DESCRIPTION
+
+Gruntmaster::App::Command is the base class of all gm commands. Its
+only role is to extract a command's documentation from its POD by
+overriding the description method to use L<Pod::Usage>.
+
+=head1 SEE ALSO
+
+L<Gruntmaster::App>, L<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
index b161904f620085bf2daeadc182d42e276c318cd2..5e8b07a91e8564b4d60602675f4d691cf8350479 100644 (file)
@@ -122,3 +122,39 @@ sub add_problem {
 
 1;
 __END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::App::Command::Add - add a problem or contest by answering a series of prompts
+
+=head1 SYNOPSIS
+
+  gm -p add aplusb
+  gm -c add test_contest
+
+=head1 DESCRIPTION
+
+The add command creates a new problem or contest by prompting the user
+for the properties of the new object. It takes a single argument, the
+ID of the new object.
+
+=head1 SEE ALSO
+
+L<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
index ab547adedd97fbf84959dc77d0907b415f9f1b18..2763f780f973fd837147422335e4a3911eabde6c 100644 (file)
@@ -25,3 +25,48 @@ sub execute {
 
 1;
 __END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::App::Command::Get - get a property of an object
+
+=head1 SYNOPSIS
+
+  gm -u get MGV name
+  # Marius Gavrilescu
+
+  gm -p get aplusb level
+  # beginner
+
+  gm -c get test_ct description
+  # This is a <b>test</b> contest.<br>
+  # Nothing to see here.
+
+  gm -j get 100 result_text
+  # Accepted
+
+=head1 DESCRIPTION
+
+The get command takes two arguments: an object id and a property name,
+and returns the value of that property.
+
+=head1 SEE ALSO
+
+L<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
index 3c62604c221178f89b090ded5352061880734c23..e447a67a8a6644c7eac1fcf46e62abd95da180f5 100644 (file)
@@ -23,3 +23,52 @@ sub execute {
 
 1;
 __END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::App::Command::List - list all objects of a type
+
+=head1 SYNOPSIS
+
+  gm -c list
+  # test_contest
+  # some_other_contest
+
+  gm -j list # This is pretty pointless
+  # 1
+  # 2
+  # 3
+
+  gm -p list
+  # aplusb
+  # aminusb
+
+  gm -u list
+  # MGV
+  # nobody
+
+=head1 DESCRIPTION
+
+The list command lists the IDs of all objects of a type, one per line.
+The list is sorted.
+
+=head1 SEE ALSO
+
+L<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
index a63800b9bf4bcfc2242d7df5cb1c1faecad50250..9c6b270d4a055ababbe74825399ab3f1411b5d84 100644 (file)
@@ -25,3 +25,37 @@ sub execute {
 
 1;
 __END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::App::Command::Rerun - rerun a job
+
+=head1 SYNOPSIS
+
+  gm rerun 123
+
+=head1 DESCRIPTION
+
+The rerun command takes the ID of a job, clears its result, and makes
+B<gruntmaster-daemon> rerun it.
+
+=head1 SEE ALSO
+
+L<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
index 25dc4504118898143d2d197ac0c66ab8da4da26d..84b42378fe990d873a4b81497ccfb1a2c34b2fdf 100644 (file)
@@ -25,3 +25,39 @@ sub execute {
 
 1;
 __END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::App::Command::Rm - remove an object
+
+=head1 SYNOPSIS
+
+  gm -c rm test_contest
+  gm -p rm aplusb
+  gm -j rm 10
+  gm -u rm MGV
+
+=head1 DESCRIPTION
+
+The rm command takes the ID of an object and removes it.
+
+=head1 SEE ALSO
+
+L<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
index b3754ddee359bd02e81616187f4818a2b33f1463..3ae62b0d507f7b81c6fb01c23365ec8dca00e199 100644 (file)
@@ -33,3 +33,41 @@ sub execute {
 
 1;
 __END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::App::Command::Set - set a property of an object
+
+=head1 SYNOPSIS
+
+  gm -u set MGV name 'Marius Gavrilescu'
+  gm -p set aplusb level beginner
+  gm -c set test_ct 'This is a <b>test</b> contest.<br>Nothing to see here'
+  gm -j set 100 result_text Accepted
+
+=head1 DESCRIPTION
+
+The set command takes three arguments: an object id, a property name,
+and a value. It sets the given property of the given object to the
+given value.
+
+=head1 SEE ALSO
+
+L<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
index 45f3eefcf2348b22d8f04b1a1c543c69c9938007..fbdac50cd9b15f7ac2a4fc7b361842036e7d020c 100644 (file)
@@ -100,3 +100,40 @@ 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<gm>
+
+=head1 AUTHOR
+
+Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
+
+=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
This page took 0.020011 seconds and 4 git commands to generate.