| 1 | # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- | ||||||||||||
| 2 | # vim: ts=4 sts=4 sw=4: | ||||||||||||
| 3 | package CPAN::Prompt; | ||||||||||||
| 4 | 24 | ▶ | use overload '""' => "as_string"; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 24 | ▶ | use vars qw($prompt); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 24 | use vars qw( | |||||||||||
| 7 | $VERSION | ||||||||||||
| 8 | 24 | ▶ | ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 24 | $VERSION = "5.5"; | |||||||||||
| 10 | |||||||||||||
| 11 | |||||||||||||
| 12 | 24 | $prompt = "cpan> "; | |||||||||||
| 13 | 24 | ▶ | $CPAN::CurrentCommandId ||= 0; | ||||||||||
|
Condition50%1/2
$CPAN::CurrentCommandId ||= 0
MC/DC0%0/1
$CPAN::CurrentCommandId ||= 0
$CPAN::CurrentCommandId
Truth table50%1/2
A
A= $CPAN::CurrentCommandId
| |||||||||||||
| 14 | sub new { | ||||||||||||
| 15 | 0 | ▶ | bless {}, shift; | ||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 16 | } | ||||||||||||
| 17 | sub as_string { | ||||||||||||
| 18 | 0 | ▶ | my $word = "cpan"; | ||||||||||
|
Subroutine
as_string: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||
| 19 | 0 | ▶ | unless ($CPAN::META->{LOCK}) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 20 | 0 | $word = "nolock_cpan"; | |||||||||||
| 21 | } | ||||||||||||
| 22 | 0 | ▶ | if ($CPAN::Config->{commandnumber_in_prompt}) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 0 | sprintf "$word\[%d]> ", $CPAN::CurrentCommandId; | |||||||||||
| 24 | } else { | ||||||||||||
| 25 | 0 | "$word> "; | |||||||||||
| 26 | } | ||||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 24 | 1; | |||||||||||