| File: | lib/Code/Statistics/App/Command/collect.pm |
| Coverage: | 100.0% |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | 2 2 2 | 0 0 0 | use strict; | ||||
| 2 | 2 2 2 | 0 0 0 | use warnings; | ||||
| 3 | |||||||
| 4 | package Code::Statistics::App::Command::collect; | ||||||
| 5 | |||||||
| 6 | # ABSTRACT: the shell command handler for stat collection | ||||||
| 7 | |||||||
| 8 | 2 2 2 | 0 0 0 | use Code::Statistics::App -command; | ||||
| 9 | |||||||
| 10 | sub abstract { return 'gather measurements on targets and write them to disk' } | ||||||
| 11 | |||||||
| 12 | sub opt_spec { | ||||||
| 13 | my ( $self ) = @_; | ||||||
| 14 | my @opts = ( | ||||||
| 15 | [ 'dirs=s' => 'the directories in which to to search for perl code files' ], | ||||||
| 16 | [ 'no_dump' => 'prevents writing of measurements to disk' ], | ||||||
| 17 | [ 'relative_paths' => 'switches file paths in dump from absolute to relative format' ], | ||||||
| 18 | [ 'foreign_paths=s' => 'file paths in dump are printed in indicated system format; see File::Spec' ], | ||||||
| 19 | [ 'targets=s' => 'specifies targets that will be looked for inside of files; see C::S::Target::*' ], | ||||||
| 20 | [ 'metrics=s' => 'specifies metrics that be tried to be measured on targets; see C::S::Metric::*' ], | ||||||
| 21 | ); | ||||||
| 22 | return @opts; | ||||||
| 23 | } | ||||||
| 24 | |||||||
| 25 | sub execute { | ||||||
| 26 | my ( $self, $opt, $arg ) = @_; | ||||||
| 27 | |||||||
| 28 | return $self->cstat( %{$opt} )->collect; | ||||||
| 29 | } | ||||||
| 30 | |||||||
| 31 | 1; | ||||||