| 1 | package Catmandu::Cmd::drop; | ||||||||||
| 2 | |||||||||||
| 3 | 14 | ▶ | use Catmandu::Sane; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 14 | our $VERSION = '1.2025'; | |||||||||
| 6 | |||||||||||
| 7 | 14 | ▶ | use parent 'Catmandu::Cmd'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 14 | ▶ | use Catmandu; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 14 | ▶ | use Catmandu::Util qw(check_able); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 14 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub command_opt_spec { | ||||||||
|
Subroutine
command_opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 13 | 0 | (["bag=s", "drop a bag"],); | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub command { | ||||||||
|
Subroutine
command: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 17 | 0 | my ($self, $opts, $args) = @_; | |||||||||
| 18 | |||||||||||
| 19 | 0 | my ($from_args, $from_opts) = $self->_parse_options($args); | |||||||||
| 20 | |||||||||||
| 21 | 0 | my $from = Catmandu->store($from_args->[0], $from_opts); | |||||||||
| 22 | 0 | ▶ | if ($opts->bag) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | check_able($from->bag($opts->bag), 'drop')->drop; | |||||||||
| 24 | } | ||||||||||
| 25 | else { | ||||||||||
| 26 | 0 | check_able($from, 'drop')->drop; | |||||||||
| 27 | } | ||||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 14 | 1; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||