| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyrights 2003-2015 by [Mark Overmeer]. |
|
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
|
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
|
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.01. |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package OODoc::Format; |
|
7
|
2
|
|
|
2
|
|
12
|
use vars '$VERSION'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
98
|
|
|
8
|
|
|
|
|
|
|
$VERSION = '2.01'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
10
|
use base 'OODoc::Object'; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
406
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
22
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
41
|
|
|
13
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
49
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
701
|
use OODoc::Manifest; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
55
|
|
|
16
|
2
|
|
|
2
|
|
11
|
use Log::Report 'oodoc'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
9
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub init($) |
|
20
|
0
|
|
|
0
|
0
|
|
{ my ($self, $args) = @_; |
|
21
|
0
|
0
|
|
|
|
|
$self->SUPER::init($args) or return; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $name = $self->{OF_project} = delete $args->{project} |
|
24
|
0
|
0
|
|
|
|
|
or error __x"formatter knows no project name"; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$self->{OF_version} = delete $args->{version} |
|
27
|
0
|
0
|
|
|
|
|
or error __x"formatter for {name} does not know the version", name => $name; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$self->{OF_workdir} = delete $args->{workdir} |
|
30
|
0
|
0
|
|
|
|
|
or error __x"no working directory specified for {name}", name => $name; |
|
31
|
|
|
|
|
|
|
|
|
32
|
0
|
|
0
|
|
|
|
$self->{OF_manifest} = delete $args->{manifest} || OODoc::Manifest->new; |
|
33
|
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
$self; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#------------------------------------------- |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
0
|
|
|
0
|
1
|
|
sub project() {shift->{OF_project}} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
1
|
|
sub version() {shift->{OF_version}} |
|
44
|
0
|
|
|
0
|
1
|
|
sub workdir() {shift->{OF_workdir}} |
|
45
|
0
|
|
|
0
|
1
|
|
sub manifest() {shift->{OF_manifest}} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#------------------------------------------- |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
|
50
|
0
|
|
|
0
|
1
|
|
sub createManual(@) {panic} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub cleanup($$) |
|
54
|
0
|
|
|
0
|
1
|
|
{ my ($self, $manual, $string) = @_; |
|
55
|
0
|
|
|
|
|
|
$manual->parser->cleanup($self, $manual, $string); |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub showChapter(@) |
|
60
|
0
|
|
|
0
|
1
|
|
{ my ($self, %args) = @_; |
|
61
|
0
|
0
|
|
|
|
|
my $chapter = $args{chapter} or panic; |
|
62
|
0
|
0
|
|
|
|
|
my $manual = $args{manual} or panic; |
|
63
|
0
|
|
0
|
|
|
|
my $show_ch = $args{show_inherited_chapter} || 'REFER'; |
|
64
|
0
|
|
0
|
|
|
|
my $show_sec = $args{show_inherited_section} || 'REFER'; |
|
65
|
0
|
|
0
|
|
|
|
my $show_ssec= $args{show_inherited_subsection} || 'REFER'; |
|
66
|
0
|
0
|
|
|
|
|
warn "show $chapter in $manual ($show_ch, $show_sec, ", ref($self), ")\n" |
|
67
|
|
|
|
|
|
|
if ref $self =~ m/pod/i; |
|
68
|
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
if($manual->inherited($chapter)) |
|
70
|
0
|
0
|
|
|
|
|
{ return $self if $show_ch eq 'NO'; |
|
71
|
0
|
|
|
|
|
|
$self->showStructureRefer(%args, structure => $chapter); |
|
72
|
0
|
|
|
|
|
|
return $self; |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
$self->showStructureExpand(%args, structure => $chapter); |
|
76
|
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
foreach my $section ($chapter->sections) |
|
78
|
0
|
0
|
|
|
|
|
{ if($manual->inherited($section)) |
|
79
|
0
|
0
|
|
|
|
|
{ next if $show_sec eq 'NO'; |
|
80
|
0
|
0
|
|
|
|
|
$self->showStructureRefer(%args, structure => $section), next |
|
81
|
|
|
|
|
|
|
unless $show_sec eq 'REFER'; |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
$self->showStructureExpand(%args, structure => $section); |
|
85
|
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
foreach my $subsection ($section->subsections) |
|
87
|
0
|
0
|
|
|
|
|
{ if($manual->inherited($subsection)) |
|
88
|
0
|
0
|
|
|
|
|
{ next if $show_ssec eq 'NO'; |
|
89
|
0
|
0
|
|
|
|
|
$self->showStructureRefer(%args, structure=>$subsection), next |
|
90
|
|
|
|
|
|
|
unless $show_ssec eq 'REFER'; |
|
91
|
|
|
|
|
|
|
} |
|
92
|
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
$self->showStructureExpand(%args, structure => $subsection); |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
} |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
#------------------------------------------- |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
101
|
0
|
|
|
0
|
1
|
|
sub showStructureExpanded(@) {panic} |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
|
104
|
0
|
|
|
0
|
1
|
|
sub showStructureRefer(@) {panic} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
#------------------------------------------- |
|
107
|
|
|
|
|
|
|
|
|
108
|
0
|
|
|
0
|
0
|
|
sub chapterName(@) {shift->showRequiredChapter(NAME => @_)} |
|
109
|
0
|
|
|
0
|
0
|
|
sub chapterSynopsis(@) {shift->showOptionalChapter(SYNOPSIS => @_)} |
|
110
|
0
|
|
|
0
|
0
|
|
sub chapterInheritance(@) {shift->showOptionalChapter(INHERITANCE => @_)} |
|
111
|
0
|
|
|
0
|
0
|
|
sub chapterDescription(@) {shift->showRequiredChapter(DESCRIPTION => @_)} |
|
112
|
0
|
|
|
0
|
0
|
|
sub chapterOverloaded(@) {shift->showOptionalChapter(OVERLOADED => @_)} |
|
113
|
0
|
|
|
0
|
0
|
|
sub chapterMethods(@) {shift->showOptionalChapter(METHODS => @_)} |
|
114
|
0
|
|
|
0
|
0
|
|
sub chapterExports(@) {shift->showOptionalChapter(EXPORTS => @_)} |
|
115
|
0
|
|
|
0
|
0
|
|
sub chapterDiagnostics(@) {shift->showOptionalChapter(DIAGNOSTICS => @_)} |
|
116
|
0
|
|
|
0
|
0
|
|
sub chapterDetails(@) {shift->showOptionalChapter(DETAILS => @_)} |
|
117
|
0
|
|
|
0
|
0
|
|
sub chapterReferences(@) {shift->showOptionalChapter(REFERENCES => @_)} |
|
118
|
0
|
|
|
0
|
0
|
|
sub chapterCopyrights(@) {shift->showOptionalChapter(COPYRIGHTS => @_)} |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
#------------------------------------------- |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub showRequiredChapter($@) |
|
124
|
0
|
|
|
0
|
1
|
|
{ my ($self, $name, %args) = @_; |
|
125
|
0
|
0
|
|
|
|
|
my $manual = $args{manual} or panic; |
|
126
|
0
|
|
|
|
|
|
my $chapter = $manual->chapter($name); |
|
127
|
|
|
|
|
|
|
|
|
128
|
0
|
0
|
|
|
|
|
unless(defined $chapter) |
|
129
|
0
|
|
|
|
|
|
{ alert "missing required chapter $name in $manual"; |
|
130
|
0
|
|
|
|
|
|
return; |
|
131
|
|
|
|
|
|
|
} |
|
132
|
|
|
|
|
|
|
|
|
133
|
0
|
|
|
|
|
|
$self->showChapter(chapter => $chapter, %args); |
|
134
|
|
|
|
|
|
|
} |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub showOptionalChapter($@) |
|
138
|
0
|
|
|
0
|
1
|
|
{ my ($self, $name, %args) = @_; |
|
139
|
0
|
0
|
|
|
|
|
my $manual = $args{manual} or panic; |
|
140
|
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
|
my $chapter = $manual->chapter($name); |
|
142
|
0
|
0
|
|
|
|
|
return unless defined $chapter; |
|
143
|
|
|
|
|
|
|
|
|
144
|
0
|
|
|
|
|
|
$self->showChapter(chapter => $chapter, %args); |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
|
|
148
|
0
|
|
|
0
|
1
|
|
sub createOtherPages(@) {shift} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub showSubroutines(@) |
|
152
|
0
|
|
|
0
|
1
|
|
{ my ($self, %args) = @_; |
|
153
|
|
|
|
|
|
|
|
|
154
|
0
|
0
|
|
|
|
|
my @subs = $args{subroutines} ? sort @{$args{subroutines}} : []; |
|
|
0
|
|
|
|
|
|
|
|
155
|
0
|
0
|
|
|
|
|
return unless @subs; |
|
156
|
|
|
|
|
|
|
|
|
157
|
0
|
0
|
|
|
|
|
my $manual = $args{manual} or panic; |
|
158
|
0
|
|
0
|
|
|
|
my $output = $args{output} || select; |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
# list is also in ::Pod3 |
|
161
|
0
|
|
0
|
|
|
|
$args{show_described_options} ||= 'EXPAND'; |
|
162
|
0
|
|
0
|
|
|
|
$args{show_described_subs} ||= 'EXPAND'; |
|
163
|
0
|
|
0
|
|
|
|
$args{show_diagnostics} ||= 'NO'; |
|
164
|
0
|
|
0
|
|
|
|
$args{show_examples} ||= 'EXPAND'; |
|
165
|
0
|
|
0
|
|
|
|
$args{show_inherited_options} ||= 'USE'; |
|
166
|
0
|
|
0
|
|
|
|
$args{show_inherited_subs} ||= 'USE'; |
|
167
|
0
|
|
0
|
|
|
|
$args{show_option_table} ||= 'ALL'; |
|
168
|
0
|
|
0
|
|
|
|
$args{show_subs_index} ||= 'NO'; |
|
169
|
|
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
|
$self->showSubsIndex(%args, subroutines => \@subs); |
|
171
|
|
|
|
|
|
|
|
|
172
|
0
|
|
|
|
|
|
for(my $index=0; $index<@subs; $index++) |
|
173
|
0
|
|
|
|
|
|
{ my $subroutine = $subs[$index]; |
|
174
|
|
|
|
|
|
|
my $show = $manual->inherited($subroutine) |
|
175
|
|
|
|
|
|
|
? $args{show_inherited_subs} |
|
176
|
0
|
0
|
|
|
|
|
: $args{show_described_subs}; |
|
177
|
|
|
|
|
|
|
|
|
178
|
0
|
|
|
|
|
|
$self->showSubroutine |
|
179
|
|
|
|
|
|
|
( %args |
|
180
|
|
|
|
|
|
|
, subroutine => $subroutine |
|
181
|
|
|
|
|
|
|
, show_subroutine => $show |
|
182
|
|
|
|
|
|
|
, last => ($index==$#subs) |
|
183
|
|
|
|
|
|
|
); |
|
184
|
|
|
|
|
|
|
} |
|
185
|
|
|
|
|
|
|
} |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub showSubroutine(@) |
|
189
|
0
|
|
|
0
|
1
|
|
{ my ($self, %args) = @_; |
|
190
|
|
|
|
|
|
|
|
|
191
|
0
|
0
|
|
|
|
|
my $subroutine = $args{subroutine} or panic; |
|
192
|
0
|
0
|
|
|
|
|
my $manual = $args{manual} or panic; |
|
193
|
0
|
|
0
|
|
|
|
my $output = $args{output} || select; |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
# |
|
196
|
|
|
|
|
|
|
# Method use |
|
197
|
|
|
|
|
|
|
# |
|
198
|
|
|
|
|
|
|
|
|
199
|
0
|
|
0
|
|
|
|
my $use = $args{show_subroutine} || 'EXPAND'; |
|
200
|
0
|
0
|
|
|
|
|
my ($show_use, $expand) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
= $use eq 'EXPAND' ? ('showSubroutineUse', 1) |
|
202
|
|
|
|
|
|
|
: $use eq 'USE' ? ('showSubroutineUse', 0) |
|
203
|
|
|
|
|
|
|
: $use eq 'NAMES' ? ('showSubroutineName', 0) |
|
204
|
|
|
|
|
|
|
: $use eq 'NO' ? (undef, 0) |
|
205
|
|
|
|
|
|
|
: error __x"illegal value for show_subroutine: {value}", value => $use; |
|
206
|
|
|
|
|
|
|
|
|
207
|
0
|
0
|
|
|
|
|
$self->$show_use(%args, subroutine => $subroutine) |
|
208
|
|
|
|
|
|
|
if defined $show_use; |
|
209
|
|
|
|
|
|
|
|
|
210
|
0
|
0
|
|
|
|
|
return unless $expand; |
|
211
|
|
|
|
|
|
|
|
|
212
|
0
|
|
0
|
|
|
|
$args{show_inherited_options} ||= 'USE'; |
|
213
|
0
|
|
0
|
|
|
|
$args{show_described_options} ||= 'EXPAND'; |
|
214
|
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
# |
|
216
|
|
|
|
|
|
|
# Subroutine descriptions |
|
217
|
|
|
|
|
|
|
# |
|
218
|
|
|
|
|
|
|
|
|
219
|
0
|
|
0
|
|
|
|
my $descr = $args{show_sub_description} || 'DESCRIBED'; |
|
220
|
0
|
|
|
|
|
|
my $description = $subroutine->findDescriptionObject; |
|
221
|
0
|
|
|
|
|
|
my $show_descr = 'showSubroutineDescription'; |
|
222
|
|
|
|
|
|
|
|
|
223
|
0
|
0
|
0
|
|
|
|
if(not $description || $descr eq 'NO') { $show_descr = undef } |
|
|
0
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
elsif($descr eq 'REFER') |
|
225
|
0
|
0
|
|
|
|
|
{ $show_descr = 'showSubroutineDescriptionRefer' |
|
226
|
|
|
|
|
|
|
if $manual->inherited($description); |
|
227
|
|
|
|
|
|
|
} |
|
228
|
|
|
|
|
|
|
elsif($descr eq 'DESCRIBED') |
|
229
|
0
|
0
|
|
|
|
|
{ $show_descr = undef if $manual->inherited($description) } |
|
230
|
|
|
|
|
|
|
elsif($descr eq 'ALL') {;} |
|
231
|
0
|
|
|
|
|
|
else { error __x"illegal value for show_sub_description: {v}", v => $descr} |
|
232
|
|
|
|
|
|
|
|
|
233
|
0
|
0
|
|
|
|
|
$self->$show_descr(%args, subroutine => $description) |
|
234
|
|
|
|
|
|
|
if defined $show_descr; |
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
# |
|
237
|
|
|
|
|
|
|
# Options |
|
238
|
|
|
|
|
|
|
# |
|
239
|
|
|
|
|
|
|
|
|
240
|
0
|
|
|
|
|
|
my $options = $subroutine->collectedOptions; |
|
241
|
|
|
|
|
|
|
|
|
242
|
0
|
|
0
|
|
|
|
my $opttab = $args{show_option_table} || 'NAMES'; |
|
243
|
0
|
|
|
|
|
|
my @options = @{$options}{ sort keys %$options }; |
|
|
0
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
# Option table |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
my @opttab |
|
248
|
|
|
|
|
|
|
= $opttab eq 'NO' ? () |
|
249
|
0
|
|
|
|
|
|
: $opttab eq 'DESCRIBED'? (grep {not $manual->inherits($_->[0])} @options) |
|
250
|
0
|
0
|
|
|
|
|
: $opttab eq 'INHERITED'? (grep {$manual->inherits($_->[0])} @options) |
|
|
0
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
: $opttab eq 'ALL' ? @options |
|
252
|
|
|
|
|
|
|
: error __x"illegal value for show_option_table: {v}", v => $opttab; |
|
253
|
|
|
|
|
|
|
|
|
254
|
0
|
0
|
|
|
|
|
$self->showOptionTable(%args, options => \@opttab) |
|
255
|
|
|
|
|
|
|
if @opttab; |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
# Option expanded |
|
258
|
|
|
|
|
|
|
|
|
259
|
0
|
|
|
|
|
|
my @optlist; |
|
260
|
0
|
|
|
|
|
|
foreach (@options) |
|
261
|
0
|
|
|
|
|
|
{ my ($option, $default) = @$_; |
|
262
|
|
|
|
|
|
|
my $check |
|
263
|
|
|
|
|
|
|
= $manual->inherited($option) ? $args{show_inherited_options} |
|
264
|
0
|
0
|
|
|
|
|
: $args{show_described_options}; |
|
265
|
0
|
0
|
0
|
|
|
|
push @optlist, $_ if $check eq 'USE' || $check eq 'EXPAND'; |
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
|
|
268
|
0
|
0
|
|
|
|
|
$self->showOptions(%args, options => \@optlist) |
|
269
|
|
|
|
|
|
|
if @optlist; |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
# Examples |
|
272
|
|
|
|
|
|
|
|
|
273
|
0
|
|
|
|
|
|
my @examples = $subroutine->examples; |
|
274
|
0
|
|
0
|
|
|
|
my $show_ex = $args{show_examples} || 'EXPAND'; |
|
275
|
0
|
0
|
|
|
|
|
$self->showExamples(%args, examples => \@examples) |
|
276
|
|
|
|
|
|
|
if $show_ex eq 'EXPAND'; |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
# Diagnostics |
|
279
|
|
|
|
|
|
|
|
|
280
|
0
|
|
|
|
|
|
my @diags = $subroutine->diagnostics; |
|
281
|
0
|
|
0
|
|
|
|
my $show_diag= $args{show_diagnostics} || 'NO'; |
|
282
|
0
|
0
|
|
|
|
|
$self->showDiagnostics(%args, diagnostics => \@diags) |
|
283
|
|
|
|
|
|
|
if $show_diag eq 'EXPAND'; |
|
284
|
|
|
|
|
|
|
} |
|
285
|
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
|
|
287
|
0
|
|
|
0
|
1
|
|
sub showExamples(@) {shift} |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
|
|
290
|
0
|
|
|
0
|
1
|
|
sub showSubroutineUse(@) {shift} |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
|
|
293
|
0
|
|
|
0
|
1
|
|
sub showSubroutineName(@) {shift} |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
|
|
296
|
0
|
|
|
0
|
1
|
|
sub showSubroutineDescription(@) {shift} |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
sub showOptionTable(@) |
|
300
|
0
|
|
|
0
|
1
|
|
{ my ($self, %args) = @_; |
|
301
|
0
|
0
|
|
|
|
|
my $options = $args{options} or panic; |
|
302
|
0
|
0
|
|
|
|
|
my $manual = $args{manual} or panic; |
|
303
|
0
|
0
|
|
|
|
|
my $output = $args{output} or panic; |
|
304
|
|
|
|
|
|
|
|
|
305
|
0
|
|
|
|
|
|
my @rows; |
|
306
|
0
|
|
|
|
|
|
foreach (@$options) |
|
307
|
0
|
|
|
|
|
|
{ my ($option, $default) = @$_; |
|
308
|
0
|
|
|
|
|
|
my $optman = $option->manual; |
|
309
|
0
|
0
|
|
|
|
|
my $link = $manual->inherited($option) |
|
310
|
|
|
|
|
|
|
? $self->link(undef, $optman) |
|
311
|
|
|
|
|
|
|
: ''; |
|
312
|
0
|
|
|
|
|
|
push @rows, [ $self->cleanup($manual, $option->name) |
|
313
|
|
|
|
|
|
|
, $link |
|
314
|
|
|
|
|
|
|
, $self->cleanup($manual, $default->value) |
|
315
|
|
|
|
|
|
|
]; |
|
316
|
|
|
|
|
|
|
} |
|
317
|
|
|
|
|
|
|
|
|
318
|
0
|
|
|
|
|
|
my @header = ('Option', 'Defined in', 'Default'); |
|
319
|
0
|
0
|
|
|
|
|
unless(grep {length $_->[1]} @rows) |
|
|
0
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
{ # removed empty "defined in" column |
|
321
|
0
|
|
|
|
|
|
splice @$_, 1, 1 for @rows, \@header; |
|
322
|
|
|
|
|
|
|
} |
|
323
|
|
|
|
|
|
|
|
|
324
|
0
|
|
|
|
|
|
$output->print("\n"); |
|
325
|
0
|
|
|
|
|
|
$self->writeTable |
|
326
|
|
|
|
|
|
|
( output => $output |
|
327
|
|
|
|
|
|
|
, header => \@header |
|
328
|
|
|
|
|
|
|
, rows => \@rows |
|
329
|
|
|
|
|
|
|
, widths => [undef, 15, undef] |
|
330
|
|
|
|
|
|
|
); |
|
331
|
|
|
|
|
|
|
|
|
332
|
0
|
|
|
|
|
|
$self |
|
333
|
|
|
|
|
|
|
} |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
sub showOptions(@) |
|
337
|
0
|
|
|
0
|
1
|
|
{ my ($self, %args) = @_; |
|
338
|
|
|
|
|
|
|
|
|
339
|
0
|
0
|
|
|
|
|
my $options = $args{options} or panic; |
|
340
|
0
|
0
|
|
|
|
|
my $manual = $args{manual} or panic; |
|
341
|
|
|
|
|
|
|
|
|
342
|
0
|
|
|
|
|
|
foreach (@$options) |
|
343
|
0
|
|
|
|
|
|
{ my ($option, $default) = @$_; |
|
344
|
|
|
|
|
|
|
my $show = $manual->inherited($option) |
|
345
|
|
|
|
|
|
|
? $args{show_inherited_options} |
|
346
|
0
|
0
|
|
|
|
|
: $args{show_described_options}; |
|
347
|
|
|
|
|
|
|
|
|
348
|
0
|
0
|
|
|
|
|
my $action |
|
|
|
0
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
= $show eq 'USE' ? 'showOptionUse' |
|
350
|
|
|
|
|
|
|
: $show eq 'EXPAND'? 'showOptionExpand' |
|
351
|
|
|
|
|
|
|
: error __x"illegal show option choice: {v}", v => $show; |
|
352
|
|
|
|
|
|
|
|
|
353
|
0
|
|
|
|
|
|
$self->$action(%args, option => $option, default => $default); |
|
354
|
|
|
|
|
|
|
} |
|
355
|
0
|
|
|
|
|
|
$self; |
|
356
|
|
|
|
|
|
|
} |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
|
|
359
|
0
|
|
|
0
|
1
|
|
sub showOptionUse(@) {shift} |
|
360
|
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
|
|
362
|
0
|
|
|
0
|
1
|
|
sub showOptionExpand(@) {shift} |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
1; |
|
366
|
|
|
|
|
|
|
|