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
|
|
24672
|
use strict; |
|
59
|
|
|
|
|
127
|
|
|
59
|
|
|
|
|
347
|
|
15
|
59
|
|
|
59
|
|
15117
|
use warnings; |
|
59
|
|
|
|
|
126
|
|
|
59
|
|
|
|
|
1071
|
|
16
|
59
|
|
|
59
|
|
311
|
use Pod::Text; |
|
59
|
|
|
|
|
133
|
|
|
59
|
|
|
|
|
1471
|
|
17
|
59
|
|
|
59
|
|
28892
|
use Pod::Simple 3.23; |
|
59
|
|
|
|
|
2202752
|
|
|
59
|
|
|
|
|
4367
|
|
18
|
59
|
|
|
59
|
|
528
|
use v5.20; |
|
59
|
|
|
|
|
1011
|
|
|
59
|
|
|
|
|
1156
|
|
19
|
59
|
|
|
59
|
|
513
|
|
|
59
|
|
|
|
|
173
|
|
20
|
|
|
|
|
|
|
use feature qw/postderef signatures/; |
21
|
59
|
|
|
59
|
|
321
|
no warnings qw/experimental::postderef experimental::signatures/; |
|
59
|
|
|
|
|
136
|
|
|
59
|
|
|
|
|
5255
|
|
22
|
59
|
|
|
59
|
|
339
|
|
|
59
|
|
|
|
|
128
|
|
|
59
|
|
|
|
|
9730
|
|
23
|
|
|
|
|
|
|
requires('get_help'); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $pod = $self->get_help(@args) ; |
26
|
159
|
|
|
159
|
1
|
234
|
return unless defined $pod; |
|
159
|
|
|
|
|
204
|
|
|
159
|
|
|
|
|
241
|
|
|
159
|
|
|
|
|
194
|
|
27
|
159
|
|
|
|
|
492
|
|
28
|
159
|
100
|
|
|
|
375
|
my $parser = Pod::Text->new( |
29
|
|
|
|
|
|
|
indent => 0, |
30
|
120
|
|
|
|
|
721
|
nourls => 1, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# require Pod::Simple 3.23 |
34
|
|
|
|
|
|
|
$parser->parse_characters('utf8'); |
35
|
|
|
|
|
|
|
|
36
|
120
|
|
|
|
|
13242
|
my $output = ''; |
37
|
|
|
|
|
|
|
$parser->output_string(\$output); |
38
|
120
|
|
|
|
|
576
|
|
39
|
120
|
|
|
|
|
371
|
$parser->parse_string_document("=pod\n\n" . $pod); |
40
|
|
|
|
|
|
|
$output =~ s/[\n\s]+$//; |
41
|
120
|
|
|
|
|
9414
|
|
42
|
120
|
|
|
|
|
36368
|
return $output; |
43
|
|
|
|
|
|
|
} |
44
|
120
|
|
|
|
|
1521
|
|
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.151 |
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 |