Skip to content

Commit

Permalink
Tweaks in headers and levels
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Oct 13, 2018
1 parent 6a34efc commit cb7233b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions doc/Language/create-cli.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ was specified). An alternative way of generating the usage information may
be provided by the developer or installed using a module.
X<|MAIN>
=head1 sub MAIN
=head2 sub MAIN
The sub with the special name C<MAIN> will be executed after all relevant entry
phasers (C<BEGIN>, C<CHECK>, C<INIT>, C<PRE>, C<ENTER>) have been run and
Expand Down Expand Up @@ -169,7 +169,7 @@ Usage:
=end code
X<%*SUB-MAIN-OPTS>
=head2 %*SUB-MAIN-OPTS
=head3 %*SUB-MAIN-OPTS
It's possible to alter how arguments are processed before they're passed
to C<sub MAIN {}> by setting options in the C<%*SUB-MAIN-OPTS> hash. Due to
Expand All @@ -188,7 +188,7 @@ For instance:
Available options are:
X<named-anywhere>
=head3 named-anywhere
=head4 named-anywhere
By default, named arguments passed to the program (i.e., C<MAIN>)
cannot appear after any positional argument. However, if
Expand All @@ -201,7 +201,7 @@ $ perl6 example.p6 1 --c=2 3 --d=4
=end code
X<hidden-from-USAGE>
=head2 is hidden-from-USAGE
=head3 is hidden-from-USAGE
Sometimes you want to exclude a MAIN candidate from being shown in any
automatically generated USAGE message. This can be achieved by adding
Expand Down Expand Up @@ -237,7 +237,8 @@ Usage:
Which, although technically correct, doesn't read as well.
=head2 X<Unit-scoped definition of MAIN|declarator,unit (MAIN)>
X<declarator,unit (MAIN)>
=head2 Unit-scoped definition of MAIN
If the entire program body resides within C<MAIN>, you can use the C<unit>
declarator as follows (adapting an earlier example):
Expand All @@ -259,7 +260,7 @@ Note that this is only appropriate if you can get by with just a single
(only) sub MAIN.
X<|USAGE>X<|$*USAGE>
=head1 sub C<USAGE>
=head2 sub USAGE
If no multi candidate of C<MAIN> is found for the given command line
parameters, the sub C<USAGE> is called. If no such method is found,
Expand Down Expand Up @@ -292,7 +293,7 @@ the L<Getopt|https://modules.perl6.org/search/?q=getopt> modules available
in the ecosystem.
X<|ARGS-TO-CAPTURE>
=head2 ARGS-TO-CAPTURE
=head2 sub ARGS-TO-CAPTURE
The C<ARGS-TO-CAPTURE> subroutine should accept two parameters: a Callable
representing the C<MAIN> unit to be executed (so it can be introspected if
Expand Down Expand Up @@ -331,7 +332,7 @@ L<Getopt|https://modules.perl6.org/search/?q=getopt> modules available in the
ecosystem.
X<|GENERATE-USAGE>
=head2 GENERATE-USAGE
=head2 sub GENERATE-USAGE
The C<GENERATE-USAGE> subroutine should accept a Callable representing the
C<MAIN> subroutine that didn't get executed because the dispatch failed.
Expand Down

0 comments on commit cb7233b

Please sign in to comment.