| 1 | package PPI::Xref::Help; | ||||||||||||
| 2 | |||||||||||||
| 3 | 0 | ▶ | sub short_help { | ||||||||||
|
Subroutine
short_help: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||
| 4 | 0 | my ($name, $fh) = @_; | |||||||||||
| 5 | 0 | ▶ | while (<$fh>) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 6 | 0 | ▶ | last if /^=head2 Usage/; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 7 | } | ||||||||||||
| 8 | 0 | ▶ | while (<$fh>) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 9 | 0 | ▶ | last if /^=head2/; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 10 | 0 | print; | |||||||||||
| 11 | } | ||||||||||||
| 12 | 0 | exit(1); | |||||||||||
| 13 | } | ||||||||||||
| 14 | |||||||||||||
| 15 | 0 | ▶ | sub long_help { | ||||||||||
|
Subroutine
long_help: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 16 | 0 | my ($name, $fh) = @_; | |||||||||||
| 17 | 0 | print <$fh>; | |||||||||||
| 18 | 0 | exit(1); | |||||||||||
| 19 | } | ||||||||||||
| 20 | |||||||||||||
| 21 | 0 | ▶ | sub man_help { | ||||||||||
|
Subroutine
man_help: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||
| 22 | 0 | my ($name, $fh) = @_; | |||||||||||
| 23 | 0 | my $man_pipe = "| pod2man --name '$name' | nroff -man"; | |||||||||||
| 24 | 0 | my $pager = $ENV{PAGER}; | |||||||||||
| 25 | 0 | ▶ | unless (defined $pager) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 0 | $pager = "less"; # Might be assuming too much. | |||||||||||
| 27 | } | ||||||||||||
| 28 | 0 | ▶ | if ($pager =~ /less/) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 0 | ▶ | my $less_opts = $ENV{LESS} // ""; | ||||||||||
|
Condition0%0/2
$ENV{"LESS"} // ""
MC/DC0%0/1
$ENV{"LESS"} // ""
$ENV{"LESS"}
Truth table0%0/2
A
A= $ENV{"LESS"}
| |||||||||||||
| 30 | 0 | ▶ | if ($less_opts !~ /-R/) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | 0 | $less_opts .= " -R" | |||||||||||
| 32 | } | ||||||||||||
| 33 | 0 | $pager .= " $less_opts"; | |||||||||||
| 34 | } | ||||||||||||
| 35 | 0 | ▶ | if (defined $pager) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 36 | 0 | $man_pipe .= " | $pager"; | |||||||||||
| 37 | } | ||||||||||||
| 38 | 0 | ▶ | if (open(my $man_fh, $man_pipe)) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 39 | 0 | print { $man_fh } <$fh>; | |||||||||||
| 40 | 0 | close($man_fh); | |||||||||||
| 41 | } | ||||||||||||
| 42 | 0 | exit(1); | |||||||||||
| 43 | } | ||||||||||||
| 44 | |||||||||||||
| 45 | 1 | 1; | |||||||||||