line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of Config-Model |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is Copyright (c) 2005-2022 by Dominique Dumont. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software, licensed under: |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# The GNU Lesser General Public License, Version 2.1, February 1999 |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
package Config::Model::Role::HelpAsText 2.153; # TRIAL |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ABSTRACT: Translate element help from pod to text |
13
|
|
|
|
|
|
|
|
14
|
59
|
|
|
59
|
|
29121
|
use Mouse::Role; |
|
59
|
|
|
|
|
190
|
|
|
59
|
|
|
|
|
399
|
|
15
|
59
|
|
|
59
|
|
17402
|
use strict; |
|
59
|
|
|
|
|
181
|
|
|
59
|
|
|
|
|
1422
|
|
16
|
59
|
|
|
59
|
|
364
|
use warnings; |
|
59
|
|
|
|
|
165
|
|
|
59
|
|
|
|
|
1671
|
|
17
|
59
|
|
|
59
|
|
38181
|
use Pod::Text; |
|
59
|
|
|
|
|
2779708
|
|
|
59
|
|
|
|
|
4889
|
|
18
|
59
|
|
|
59
|
|
621
|
use Pod::Simple 3.23; |
|
59
|
|
|
|
|
1199
|
|
|
59
|
|
|
|
|
1442
|
|
19
|
59
|
|
|
59
|
|
630
|
use v5.20; |
|
59
|
|
|
|
|
226
|
|
20
|
|
|
|
|
|
|
|
21
|
59
|
|
|
59
|
|
451
|
use feature qw/postderef signatures/; |
|
59
|
|
|
|
|
181
|
|
|
59
|
|
|
|
|
6047
|
|
22
|
59
|
|
|
59
|
|
473
|
no warnings qw/experimental::postderef experimental::signatures/; |
|
59
|
|
|
|
|
187
|
|
|
59
|
|
|
|
|
12420
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
requires('get_help'); |
25
|
|
|
|
|
|
|
|
26
|
159
|
|
|
159
|
1
|
247
|
sub get_help_as_text ($self, @args) { |
|
159
|
|
|
|
|
233
|
|
|
159
|
|
|
|
|
275
|
|
|
159
|
|
|
|
|
233
|
|
27
|
159
|
|
|
|
|
491
|
my $pod = $self->get_help(@args) ; |
28
|
159
|
100
|
|
|
|
444
|
return unless defined $pod; |
29
|
|
|
|
|
|
|
|
30
|
120
|
|
|
|
|
641
|
my $parser = Pod::Text->new( |
31
|
|
|
|
|
|
|
indent => 0, |
32
|
|
|
|
|
|
|
nourls => 1, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# require Pod::Simple 3.23 |
36
|
120
|
|
|
|
|
14135
|
$parser->parse_characters('utf8'); |
37
|
|
|
|
|
|
|
|
38
|
120
|
|
|
|
|
656
|
my $output = ''; |
39
|
120
|
|
|
|
|
368
|
$parser->output_string(\$output); |
40
|
|
|
|
|
|
|
|
41
|
120
|
|
|
|
|
9062
|
$parser->parse_string_document("=pod\n\n" . $pod); |
42
|
120
|
|
|
|
|
41088
|
$output =~ s/[\n\s]+$//; |
43
|
|
|
|
|
|
|
|
44
|
120
|
|
|
|
|
1718
|
return $output; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=pod |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=encoding UTF-8 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 NAME |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Config::Model::Role::HelpAsText - Translate element help from pod to text |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 VERSION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
version 2.153 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 SYNOPSIS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$self->get_help_as_text( ... ); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 DESCRIPTION |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Role used to transform Config::Model help text or description from pod |
70
|
|
|
|
|
|
|
to text. The provided method should be used when the help text should |
71
|
|
|
|
|
|
|
be displayed on STDOUT. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This functionality is provided as a role because the interface to |
74
|
|
|
|
|
|
|
L<Pod::Text> is not so easy. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 METHODS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 get_help_as_text |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Calls C<get_help> and transform the Pod output to text. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 SEE ALSO |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L<Pod::Text>, L<Pod::Simple> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 AUTHOR |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Dominique Dumont |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This software is Copyright (c) 2005-2022 by Dominique Dumont. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This is free software, licensed under: |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
The GNU Lesser General Public License, Version 2.1, February 1999 |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |