| 1 | package MooseX::Getopt::Usage::Pod::Text; | ||||||||||
| 2 | |||||||||||
| 3 | 44 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 44 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 44 | our $VERSION = '0.24'; | |||||||||
| 6 | |||||||||||
| 7 | 44 | ▶ | use base qw(Pod::Text); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 26 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||
| 10 | 26 | my $proto = shift; | |||||||||
| 11 | 26 | my %args = @_; | |||||||||
| 12 | 26 | my $self = $proto->SUPER::new(@_); | |||||||||
| 13 | 26 | ▶ | return unless $self; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 26 | ▶ | $self->{headings} = exists $args{headings} ? $args{headings} : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 26 | ▶ | $self->{opt_indent} = 0 if !$self->{headings}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 26 | return $self; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 52 | ▶ | sub heading { | ||||||||
|
Subroutine
heading: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||
| 20 | 52 | my ($self, $text, $indent, $marker) = @_; | |||||||||
| 21 | 52 | ▶ | return unless $self->{headings}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | # Try to do some lowercasing instead of all-caps in headings, and use | ||||||||||
| 23 | # a colon to end all headings. | ||||||||||
| 24 | 49 | ▶ | $text =~ s{([A-Z])([A-Z]+)}{((length($2) > 2) ? $1 : lc($1)) . lc($2)}ge; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 49 | ▶ | $text .= ":" unless $text =~ /:$/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 49 | return $self->SUPER::heading($text, $indent, $marker); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 52 | ▶ | sub cmd_head1 { | ||||||||
|
Subroutine
cmd_head1: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 30 | 52 | my ($self, $attrs, $text) = @_; | |||||||||
| 31 | 52 | $text =~ s{SYNOPSIS}{USAGE}; | |||||||||
| 32 | 52 | $self->SUPER::cmd_head1($attrs, $text); | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 44 | 1; | |||||||||
| 36 | __END__ | ||||||||||