@@ -34,7 +34,7 @@ was specified). An alternative way of generating the usage information may
34
34
be provided by the developer or installed using a module.
35
35
36
36
X < |MAIN >
37
- = head1 sub MAIN
37
+ = head2 sub MAIN
38
38
39
39
The sub with the special name C < MAIN > will be executed after all relevant entry
40
40
phasers (C < BEGIN > , C < CHECK > , C < INIT > , C < PRE > , C < ENTER > ) have been run and
@@ -169,7 +169,7 @@ Usage:
169
169
= end code
170
170
171
171
X < %*SUB-MAIN-OPTS >
172
- = head2 %*SUB-MAIN-OPTS
172
+ = head3 %*SUB-MAIN-OPTS
173
173
174
174
It's possible to alter how arguments are processed before they're passed
175
175
to C < sub MAIN {} > by setting options in the C < %*SUB-MAIN-OPTS > hash. Due to
@@ -188,7 +188,7 @@ For instance:
188
188
Available options are:
189
189
190
190
X < named-anywhere >
191
- = head3 named-anywhere
191
+ = head4 named-anywhere
192
192
193
193
By default, named arguments passed to the program (i.e., C < MAIN > )
194
194
cannot appear after any positional argument. However, if
@@ -201,7 +201,7 @@ $ perl6 example.p6 1 --c=2 3 --d=4
201
201
= end code
202
202
203
203
X < hidden-from-USAGE >
204
- = head2 is hidden-from-USAGE
204
+ = head3 is hidden-from-USAGE
205
205
206
206
Sometimes you want to exclude a MAIN candidate from being shown in any
207
207
automatically generated USAGE message. This can be achieved by adding
@@ -237,7 +237,8 @@ Usage:
237
237
238
238
Which, although technically correct, doesn't read as well.
239
239
240
- = head2 X < Unit-scoped definition of MAIN|declarator,unit (MAIN) >
240
+ X < declarator,unit (MAIN) >
241
+ = head2 Unit-scoped definition of MAIN
241
242
242
243
If the entire program body resides within C < MAIN > , you can use the C < unit >
243
244
declarator as follows (adapting an earlier example):
@@ -259,7 +260,7 @@ Note that this is only appropriate if you can get by with just a single
259
260
(only) sub MAIN.
260
261
261
262
X < |USAGE > X < |$*USAGE >
262
- = head1 sub C < USAGE >
263
+ = head2 sub USAGE
263
264
264
265
If no multi candidate of C < MAIN > is found for the given command line
265
266
parameters, the sub C < USAGE > is called. If no such method is found,
@@ -292,7 +293,7 @@ the L<Getopt|https://modules.perl6.org/search/?q=getopt> modules available
292
293
in the ecosystem.
293
294
294
295
X < |ARGS-TO-CAPTURE >
295
- = head2 ARGS-TO-CAPTURE
296
+ = head2 sub ARGS-TO-CAPTURE
296
297
297
298
The C < ARGS-TO-CAPTURE > subroutine should accept two parameters: a Callable
298
299
representing the C < MAIN > unit to be executed (so it can be introspected if
@@ -331,7 +332,7 @@ L<Getopt|https://modules.perl6.org/search/?q=getopt> modules available in the
331
332
ecosystem.
332
333
333
334
X < |GENERATE-USAGE >
334
- = head2 GENERATE-USAGE
335
+ = head2 sub GENERATE-USAGE
335
336
336
337
The C < GENERATE-USAGE > subroutine should accept a Callable representing the
337
338
C < MAIN > subroutine that didn't get executed because the dispatch failed.
0 commit comments