Commit | Line | Data |
---|---|---|
6c01e3e3 MG |
1 | package App::Zealc::Command; |
2 | ||
3 | use 5.014000; | |
4 | use strict; | |
5 | use warnings; | |
6 | ||
7 | our $VERSION = '0.000_001'; | |
8 | ||
9 | use parent qw/App::Cmd::Command/; | |
10 | use App::Zealc::UsageExtractor; | |
11 | ||
12 | sub description { | |
13 | my ($self) = @_; | |
14 | my ($file) = (ref $self) =~ s,::,/,gr; | |
15 | my $parser = App::Zealc::UsageExtractor->new; | |
16 | $parser->parse_file($INC{"$file.pm"}); | |
17 | return $parser->usage | |
18 | } | |
19 | ||
20 | 1; | |
21 | __END__ | |
22 | ||
23 | =encoding utf-8 | |
24 | ||
25 | =head1 NAME | |
26 | ||
27 | App::Zealc::Command - Base class for zealc commands | |
28 | ||
29 | =head1 SYNOPSIS | |
30 | ||
31 | package App::Zealc::Command::foo; | |
32 | use App::Zealc '-command'; | |
33 | ||
34 | =head1 DESCRIPTION | |
35 | ||
36 | App::Zealc::Command is the base class of all zealc commands. Its only | |
37 | role is to supply a default C<description> method that extracts the | |
38 | SYNOPSIS and DESCRIPTION sections using L<App::Zealc::UsageExtractor>. | |
39 | ||
40 | =head1 SEE ALSO | |
41 | ||
42 | L<App::Zealc::UsageExtractor>, L<zealc>, L<Zeal> | |
43 | ||
44 | =head1 AUTHOR | |
45 | ||
46 | Marius Gavrilescu, E<lt>marius@ieval.roE<gt> | |
47 | ||
48 | =head1 COPYRIGHT AND LICENSE | |
49 | ||
50 | Copyright (C) 2015 by Marius Gavrilescu | |
51 | ||
52 | This library is free software; you can redistribute it and/or modify | |
53 | it under the same terms as Perl itself, either Perl version 5.20.1 or, | |
54 | at your option, any later version of Perl 5 you may have available. | |
55 | ||
56 | ||
57 | =cut |