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