| 1 | package oCLI::Command; | ||
| 2 | 1 | ▶ | use Import::Into; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use Package::Stash; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | push our @ISA, qw( Exporter ); | |
| 5 | 1 | push our @EXPORT, qw( setup define ); | |
| 6 | |||
| 7 | 1 | ▶ | sub import { |
|
Subroutine
import: called CC=1 SCAR=0.0
| |||
| 8 | 1 | shift->export_to_level(1); | |
| 9 | 1 | my $target = caller; | |
| 10 | 1 | Package::Stash->new($target)->add_symbol( '%stash', { class => $target } ); | |
| 11 | 1 | Moo->import::into($target); | |
| 12 | } | ||
| 13 | |||
| 14 | 0 | ▶ | sub define { |
|
Subroutine
define: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 15 | 0 | my ( $name, @args ) = @_; | |
| 16 | |||
| 17 | 0 | ${Package::Stash->new(scalar caller)->get_symbol('%stash')}{command}->{$name} = { @args }; | |
| 18 | } | ||
| 19 | |||
| 20 | 0 | ▶ | sub setup { |
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 21 | 0 | my ( $name, @args ) = @_; | |
| 22 | |||
| 23 | 0 | ${Package::Stash->new(scalar caller)->get_symbol('%stash')}{info} = { name => $name, @args }; | |
| 24 | } | ||
| 25 | |||
| 26 | 1 | 1; | |