sub ARGS-TO-CAPTURE
Documentation for sub ARGS-TO-CAPTURE
assembled from the following types:
language documentation Command line interface
(Command line interface) sub ARGS-TO-CAPTURE
The ARGS-TO-CAPTURE
subroutine should accept two parameters: a Callable representing the MAIN
unit to be executed (so it can be introspected if necessary) and an array with the arguments from the command line. It should return a Capture object that will be used to dispatch the MAIN
unit. The following is a very contrived example that will create a Capture
depending on some keyword that was entered (which can be handy during testing of a command line interface of a script):
sub ARGS-TO-CAPTURE(, --> Capture)
Note that the dynamic variable &*ARGS-TO-CAPTURE
is available to perform the default command line arguments to Capture
processing so you don't have to reinvent the whole wheel if you don't want to.