Write POD for Gruntmaster::App::*
[gruntmaster-data.git] / lib / Gruntmaster / App / Command.pm
CommitLineData
63afa40a
MG
1package Gruntmaster::App::Command;
2
3use 5.014000;
4use strict;
5use warnings;
6
7our $VERSION = '5999.000_004';
8
9use parent qw/App::Cmd::Command/;
10use Pod::Usage;
11
12sub description {
13 my ($self) = @_;
14 my ($file) = (ref $self) =~ s,::,/,gr;
15 my $usage;
16 open my $fh, '>', \$usage;
17 pod2usage(-input => $INC{"$file.pm"}, -output => $fh, -exitval => 'NOEXIT', -verbose => 99, -sections => [qw/SYNOPSIS DESCRIPTION/]);
18 close $fh;
19 $usage =~ s/Usage:/Usage examples:/;
20 1 while chomp $usage;
21 $usage
22}
23
241;
25__END__
26
27=encoding utf-8
28
29=head1 NAME
30
31Gruntmaster::App::Command - Base class for gm commands
32
33=head1 SYNOPSIS
34
35 package Gruntmaster::App::Command::foo;
36 use Gruntmaster::App '-command';
37
38=head1 DESCRIPTION
39
40Gruntmaster::App::Command is the base class of all gm commands. Its
41only role is to extract a command's documentation from its POD by
42overriding the description method to use L<Pod::Usage>.
43
44=head1 SEE ALSO
45
46L<Gruntmaster::App>, L<gm>
47
48=head1 AUTHOR
49
50Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
51
52=head1 COPYRIGHT AND LICENSE
53
54Copyright (C) 2015 by Marius Gavrilescu
55
56This library is free software; you can redistribute it and/or modify
57it under the same terms as Perl itself, either Perl version 5.20.1 or,
58at your option, any later version of Perl 5 you may have available.
59
60
61=cut
This page took 0.013885 seconds and 4 git commands to generate.