File Coverage

blib/lib/oCLI/Command.pm
Criterion Covered Total %
statement 10 16 62.5
branch n/a
condition n/a
subroutine 3 5 60.0
pod 0 2 0.0
total 13 23 56.5


line stmt bran cond sub pod time code
1             package oCLI::Command;
2 1     1   2547 use Import::Into;
  1         544  
  1         33  
3 1     1   7 use Package::Stash;
  1         2  
  1         230  
4             push our @ISA, qw( Exporter );
5             push our @EXPORT, qw( setup define );
6              
7             sub import {
8 1     1   128 shift->export_to_level(1);
9 1         4 my $target = caller;
10 1         48 Package::Stash->new($target)->add_symbol( '%stash', { class => $target } );
11 1         20 Moo->import::into($target);
12             }
13              
14             sub define {
15 0     0 0   my ( $name, @args ) = @_;
16              
17 0           ${Package::Stash->new(scalar caller)->get_symbol('%stash')}{command}->{$name} = { @args };
  0            
18             }
19              
20             sub setup {
21 0     0 0   my ( $name, @args ) = @_;
22              
23 0           ${Package::Stash->new(scalar caller)->get_symbol('%stash')}{info} = { name => $name, @args };
  0            
24             }
25              
26             1;