| 1 | package App::GitGot::Command::remove; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 16 | our $AUTHORITY = 'cpan:GENEHACK'; | |||||||||||||||||||||||||||||||||||||||||||||
| 3 | 16 | $App::GitGot::Command::remove::VERSION = '1.339'; | |||||||||||||||||||||||||||||||||||||||||||||
| 4 | # ABSTRACT: remove a managed repository from your config | ||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 16 | ▶ | use 5.014; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 16 | ▶ | use List::Util qw/ any /; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 16 | ▶ | use App::GitGot -command; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 16 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 16 | extends 'App::GitGot::Command'; | |||||||||||||||||||||||||||||||||||||||||||||
| 13 | 16 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 45 | ▶ | sub command_names { qw/ remove rm / } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
command_names: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 3 | ▶ | sub options { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
options: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 3 | my( $class , $app ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 19 | return ( | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 3 | [ 'force' => 'FIXME' ] , | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 3 | ▶ | sub _use_io_page { 0 } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_use_io_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 3 | ▶ | sub _execute { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_execute: called CC=9 SCAR=22.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 3 | my( $self, $opt, $args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 3 | ▶ | unless ( $self->active_repos and @$args or $self->tags) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
$self->active_repos and @$args or $self->tags
$self->active_repos and @$args
MC/DC33%1/3
$self->active_repos and @$args or $self->tags
$self->active_repos
@$args
$self->tags
Truth table40%2/5
A and B or C
A= $self->active_reposB= @$argsC= $self->tags
| |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | say STDERR "ERROR: You need to select one or more repos to remove"; | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | exit(1); | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 2 | my @new_repo_list; | |||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | REPO: for my $repo ( $self->all_repos ) { | |||||||||||||||||||||||||||||||||||||||||||||
| 37 | 7 | my $number = $repo->number; | |||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 7 | ▶ | if ( any { $number == $_->number } $self->active_repos ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 2 | my $name = $repo->label; | |||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | ▶ | if ( $self->opt->force or $self->prompt_yn( "got rm: remove '$name'?" )) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->opt->force or $self->prompt_yn("got rm: remove '${name}'?")
MC/DC0%0/2
$self->opt->force or $self->prompt_yn("got rm: remove '${name}'?")
$self->opt->force
$self->prompt_yn("got rm: remove '${name}'?")
Truth table33%1/3
A or B
A= $self->opt->forceB= $self->prompt_yn("got rm: remove '${name}'?")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 2 | ▶ | say "Removed repo '$name'" if $self->verbose; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 2 | next REPO; | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 5 | push @new_repo_list , $repo; | |||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 2 | $self->set_full_repo_list( \@new_repo_list ); | |||||||||||||||||||||||||||||||||||||||||||||
| 51 | 2 | $self->write_config(); | |||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 16 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||
| 56 | ## FIXME docs | ||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||
| 58 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||