| 1 | package P5U::Command::TestPod; | ||
| 2 | |||
| 3 | use 5.010; | ||
| 4 | use strict; | ||
| 5 | use utf8; | ||
| 6 | use P5U-command; | ||
| 7 | |||
| 8 | BEGIN { | ||
| 9 | $P5U::Command::TestPod::AUTHORITY = 'cpan:TOBYINK'; | ||
| 10 | $P5U::Command::TestPod::VERSION = '0.100'; | ||
| 11 | }; | ||
| 12 | |||
| 13 | use constant { | ||
| 14 | abstract => q[run Test::Pod on given files], | ||
| 15 | usage_desc => q[%c testpod %o Files], | ||
| 16 | }; | ||
| 17 | |||
| 18 | sub command_names | ||
| 19 | { | ||
| 20 | qw( | ||
| 21 | testpod | ||
| 22 | tp | ||
| 23 | ); | ||
| 24 | } | ||
| 25 | |||
| 26 | sub opt_spec | ||
| 27 | { | ||
| 28 | return () | ||
| 29 | } | ||
| 30 | |||
| 31 | sub execute | ||
| 32 | { | ||
| 33 | require P5U::Lib::TestPod; | ||
| 34 | |||
| 35 | my ($self, $opt, $args) = @_; | ||
| 36 | |||
| 37 | if (not @$args) | ||
| 38 | { | ||
| 39 | -d 'lib' or $self->usage_error("please provide a list of files/directories"); | ||
| 40 | $args = ['lib']; | ||
| 41 | } | ||
| 42 | |||
| 43 | P5U::Lib::TestPod::->test_pod(@$args); | ||
| 44 | } | ||
| 45 | |||
| 46 | 1; |