| 1 | # ABSTRACT: create a new stack by copying another | ||||||||||
| 2 | |||||||||||
| 3 | package App::Pinto::Command::copy; | ||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | #----------------------------------------------------------------------------- | ||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use base 'App::Pinto::Command'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | #------------------------------------------------------------------------------ | ||||||||||
| 13 | |||||||||||
| 14 | 1 | our $VERSION = '0.14'; # VERSION | |||||||||
| 15 | |||||||||||
| 16 | #------------------------------------------------------------------------------ | ||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub command_names { return qw(copy cp) } | ||||||||
|
Subroutine
command_names: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 19 | |||||||||||
| 20 | #------------------------------------------------------------------------------ | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub opt_spec { | ||||||||
|
Subroutine
opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 23 | 0 | my ( $self, $app ) = @_; | |||||||||
| 24 | |||||||||||
| 25 | return ( | ||||||||||
| 26 | 0 | [ 'default' => 'Make the new stack the default stack' ], | |||||||||
| 27 | [ 'description|d=s' => 'Brief description of the stack' ], | ||||||||||
| 28 | [ 'lock' => 'Lock the new stack to prevent changes' ], | ||||||||||
| 29 | ); | ||||||||||
| 30 | |||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | #------------------------------------------------------------------------------ | ||||||||||
| 34 | 0 | ▶ | sub validate_args { | ||||||||
|
Subroutine
validate_args: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 35 | 0 | my ( $self, $opts, $args ) = @_; | |||||||||
| 36 | |||||||||||
| 37 | $self->usage_error('Must specify STACK and TO_STACK') | ||||||||||
| 38 | 0 | ▶ | if @{$args} != 2; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | |||||||||||
| 40 | 0 | return 1; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | #------------------------------------------------------------------------------ | ||||||||||
| 44 | |||||||||||
| 45 | 0 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 46 | 0 | my ( $self, $opts, $args ) = @_; | |||||||||
| 47 | |||||||||||
| 48 | 0 | my %stacks = ( stack => $args->[0], to_stack => $args->[1] ); | |||||||||
| 49 | 0 | my $result = $self->pinto->run( $self->action_name, %{$opts}, %stacks ); | |||||||||
| 50 | |||||||||||
| 51 | 0 | return $result->exit_status; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | #------------------------------------------------------------------------------ | ||||||||||
| 55 | 1 | 1; | |||||||||
| 56 | |||||||||||
| 57 | __END__ | ||||||||||