| 1 | package App::gh::Command::Setup; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use base qw(App::gh::Command); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 0 | ▶ | sub run { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 8 | 0 | my ( $type , $id , $arg ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | print <<'END' unless ( $type && $id && $arg ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$type and $id and $arg
$type and $id
MC/DC0%0/3
$type and $id and $arg
$type
$id
$arg
Truth table0%0/4
A and B and C
A= $typeB= $idC= $arg
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | Type, id , token|email is required. | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | Setup command usage: | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | \$ gh setup github [id] [token] | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | \$ gh setup git [name] [email] | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | See help: | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | \$ gh help setup | ||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | END | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | return unless ( $type && $id && $arg ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$type and $id and $arg
$type and $id
MC/DC0%0/3
$type and $id and $arg
$type
$id
$arg
Truth table0%0/4
A and B and C
A= $typeB= $idC= $arg
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | if( $type eq 'github' || $type eq 'gh' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$type eq "github" or $type eq "gh"
MC/DC0%0/2
$type eq "github" or $type eq "gh"
$type eq "github"
$type eq "gh"
Truth table0%0/3
A or B
A= $type eq "github"B= $type eq "gh"
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | qx(git config --global github.user "$id"); | |||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | qx(git config --global github.token "$arg"); | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | elsif( $type eq 'git' ) { | ||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | qx( git config --global user.name "$id" ); | |||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | qx( git config --global user.email "$arg" ); | |||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | print "Done\n"; | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||||||||||||||||||||||||