Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document &*ARGS-TO-CAPTURE, &*GENERATE-USAGE on the variables page.
Move documentation from Language/create-cli.pod6; cross reference.
This also fixes broken links to:

- /language/&*ARGS-TO-CAPTURE
- /language/&*GENERATE-USAGE
  • Loading branch information
cfa committed Jan 10, 2019
1 parent f9481e1 commit 2424e62
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
22 changes: 5 additions & 17 deletions doc/Language/create-cli.pod6
Expand Up @@ -312,17 +312,11 @@ during testing of a command line interface of a script):
!! &*ARGS-TO-CAPTURE(&main, @args)
}
Note that the dynamic variable L<&*ARGS-TO-CAPTURE> is available to perform
Note that the dynamic variable L<C<&*ARGS-TO-CAPTURE>|/language/variables#&*ARGS-TO-CAPTURE>
is available to perform
the default command line arguments to C<Capture> processing so you don't
have to reinvent the whole wheel if you don't want to.
X<|&*ARGS-TO-CAPTURE>
=head2 &*ARGS-TO-CAPTURE
A dynamic variable available inside any custom C<ARGS-TO-CAPTURE> subroutine
that can be used to perform the default argument parsing. Takes the same
parameters as are expected of the custom C<ARGS-TO-CAPTURE> subroutine.
=head1 Intercepting usage message generation (2018.10, v6.d and later)
You can replace or augment the default way of usage message generation
Expand Down Expand Up @@ -357,17 +351,11 @@ You can also use multi subroutines to create the same effect:
&*GENERATE-USAGE(&main, |capture)
}
Note that the dynamic variable L<&*GENERATE-USAGE> is available to perform
Note that the dynamic variable L<C<&*GENERATE-USAGE>|/language/variables#&*GENERATE-USAGE>
is available to perform
the default usage message generation so you don't have to reinvent the
whole wheel if you don't want to.
X<|&*GENERATE-USAGE>
=head2 &*GENERATE-USAGE
A dynamic variable available inside any custom C<GENERATE-USAGE> subroutine
that can be used to perform the default usage message creation. Takes the
same parameters as are expected of the custom C<GENERATE-USAGE> subroutine.
=head1 Intercepting MAIN calling (before 2018.10, v6.e)
An older interface enabled one to intercept the calling to C<MAIN> completely.
Expand All @@ -389,4 +377,4 @@ then the support for the old interface can be removed from the module.
=end pod

# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
16 changes: 16 additions & 0 deletions doc/Language/variables.pod6
Expand Up @@ -1241,6 +1241,22 @@ when C<@*ARGS> is not empty.
C<@*ARGS> contains the arguments from the command line.
X<|&*ARGS-TO-CAPTURE>
=head4 C<&*ARGS-TO-CAPTURE>
A dynamic variable available inside any custom
L<C<ARGS-TO-CAPTURE>|/language/create-cli#sub_ARGS-TO-CAPTURE> subroutine
that can be used to perform the default argument parsing. Takes the same
parameters as are expected of the custom C<ARGS-TO-CAPTURE> subroutine.
X<|&*GENERATE-USAGE>
=head4 C<&*GENERATE-USAGE>
A dynamic variable available inside any custom
L<C<GENERATE-USAGE>|/language/create-cli#sub_GENERATE-USAGE> subroutine
that can be used to perform the default usage message creation. Takes the
same parameters as are expected of the custom C<GENERATE-USAGE> subroutine.
X<|$*IN>X<|$*OUT>X<|$*ERR>
=head3 Special filehandles: C<STDIN>, C<STDOUT> and C<STDERR>
Expand Down

0 comments on commit 2424e62

Please sign in to comment.