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
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Translate element help from pod to text |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Mouse::Role; |
14
|
59
|
|
|
59
|
|
25370
|
use strict; |
|
59
|
|
|
|
|
126
|
|
|
59
|
|
|
|
|
364
|
|
15
|
59
|
|
|
59
|
|
16021
|
use warnings; |
|
59
|
|
|
|
|
118
|
|
|
59
|
|
|
|
|
1183
|
|
16
|
59
|
|
|
59
|
|
325
|
use Pod::Text; |
|
59
|
|
|
|
|
144
|
|
|
59
|
|
|
|
|
1503
|
|
17
|
59
|
|
|
59
|
|
29507
|
use Pod::Simple 3.23; |
|
59
|
|
|
|
|
2236306
|
|
|
59
|
|
|
|
|
4276
|
|
18
|
59
|
|
|
59
|
|
525
|
use v5.20; |
|
59
|
|
|
|
|
987
|
|
|
59
|
|
|
|
|
1203
|
|
19
|
59
|
|
|
59
|
|
533
|
|
|
59
|
|
|
|
|
182
|
|
20
|
|
|
|
|
|
|
use feature qw/postderef signatures/; |
21
|
59
|
|
|
59
|
|
316
|
no warnings qw/experimental::postderef experimental::signatures/; |
|
59
|
|
|
|
|
115
|
|
|
59
|
|
|
|
|
5271
|
|
22
|
59
|
|
|
59
|
|
340
|
|
|
59
|
|
|
|
|
121
|
|
|
59
|
|
|
|
|
10285
|
|
23
|
|
|
|
|
|
|
requires('get_help'); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $pod = $self->get_help(@args) ; |
26
|
159
|
|
|
159
|
1
|
205
|
return unless defined $pod; |
|
159
|
|
|
|
|
194
|
|
|
159
|
|
|
|
|
251
|
|
|
159
|
|
|
|
|
180
|
|
27
|
159
|
|
|
|
|
366
|
|
28
|
159
|
100
|
|
|
|
326
|
my $parser = Pod::Text->new( |
29
|
|
|
|
|
|
|
indent => 0, |
30
|
120
|
|
|
|
|
543
|
nourls => 1, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# require Pod::Simple 3.23 |
34
|
|
|
|
|
|
|
$parser->parse_characters('utf8'); |
35
|
|
|
|
|
|
|
|
36
|
120
|
|
|
|
|
11356
|
my $output = ''; |
37
|
|
|
|
|
|
|
$parser->output_string(\$output); |
38
|
120
|
|
|
|
|
572
|
|
39
|
120
|
|
|
|
|
314
|
$parser->parse_string_document("=pod\n\n" . $pod); |
40
|
|
|
|
|
|
|
$output =~ s/[\n\s]+$//; |
41
|
120
|
|
|
|
|
7016
|
|
42
|
120
|
|
|
|
|
32444
|
return $output; |
43
|
|
|
|
|
|
|
} |
44
|
120
|
|
|
|
|
1372
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=encoding UTF-8 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 NAME |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Config::Model::Role::HelpAsText - Translate element help from pod to text |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 VERSION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
version 2.152 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SYNOPSIS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
$self->get_help_as_text( ... ); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Role used to transform Config::Model help text or description from pod |
67
|
|
|
|
|
|
|
to text. The provided method should be used when the help text should |
68
|
|
|
|
|
|
|
be displayed on STDOUT. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This functionality is provided as a role because the interface to |
71
|
|
|
|
|
|
|
L<Pod::Text> is not so easy. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 METHODS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 get_help_as_text |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Calls C<get_help> and transform the Pod output to text. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 SEE ALSO |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L<Pod::Text>, L<Pod::Simple> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Dominique Dumont |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This software is Copyright (c) 2005-2022 by Dominique Dumont. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This is free software, licensed under: |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
The GNU Lesser General Public License, Version 2.1, February 1999 |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |