Skip to content

Commit 0cde53b

Browse files
authored
tweak grammar and spelling
1 parent aa121b3 commit 0cde53b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

doc/Language/create-cli.pod6

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
X<|command line arguments>
88
=head1 Command Line Interface - an overview
99
10-
The default command line interface of Perl 6 scripts consists of 3 parts:
10+
The default command line interface of Perl 6 scripts consists of three parts:
1111
1212
=item parsing the command line parameters into a L<capture|/type/Capture>
1313
1414
This looks at the values in L<@*ARGS|/language/variables#index-entry-@*ARGS>,
15-
interpretes these according to some policy, and creates a C<Capture> object
15+
interprets these according to some policy, and creates a C<Capture> object
1616
out of that. An alternative way of parsing may be provided by the developer
1717
or installed using a module.
1818
@@ -21,7 +21,7 @@ or installed using a module.
2121
Standard L<multi dispatch|/language/functions#index-entry-declarator_multi-Multi-dispatch>
2222
is used to call the MAIN subroutine with the generated C<Capture> object.
2323
This means that your MAIN subroutine may be a C<multi sub>, each candidate
24-
of which responsible for some part of processing the given command line
24+
of which is responsible for some part of processing the given command line
2525
arguments.
2626
2727
=item creating / showing USAGE information if calling MAIN failed
@@ -38,7 +38,7 @@ X<|MAIN>
3838
3939
The sub with the special name C<MAIN> will be executed after all relevant entry
4040
phasers (C<BEGIN>, C<CHECK>, C<INIT>, C<PRE>, C<ENTER>) have been run and
41-
the mainline of the script have been executed. No error will occur if there
41+
the mainline of the script has been executed. No error will occur if there
4242
is no MAIN sub: your script will then just have to do the work, such as
4343
argument parsing, in the mainline of the script.
4444
@@ -89,14 +89,14 @@ $ perl6 hello.p6 Liz
8989
Hello Liz, how are you?
9090
=end code
9191
92-
Another way to do this, is to make sub MAIN a C<multi sub>:
92+
Another way to do this is to make sub MAIN a C<multi sub>:
9393
9494
# inside file 'hello.p6'
9595
multi sub MAIN() { say "Hello bashful, how are you?" }
9696
multi sub MAIN($name) { say "Hello $name, how are you?" }
9797
9898
Which would give the same output as the examples above. Whether you should
99-
use either method to achieve the desired goal, is entirely up to you.
99+
use either method to achieve the desired goal is entirely up to you.
100100
101101
A more complicated example using a single positional and multiple
102102
named parameters:
@@ -141,7 +141,7 @@ Usage:
141141
142142
Although you don't have to do anything in your code to do this, it may still
143143
be regarded as a bit terse. But there's an easy way to make that usage
144-
message better: by providing hints using pod features:
144+
message better by providing hints using pod features:
145145
146146
# inside "frobnicate.p6"
147147
sub MAIN(
@@ -282,7 +282,7 @@ C<#|(...)> Pod block to set L«C<WHY>|/routine/WHY».
282282
283283
=head1 Intercepting CLI argument parsing (2018.10, v6.d and later)
284284
285-
You can replace / augment the default way of argument parsing by supplying a
285+
You can replace or augment the default way of argument parsing by supplying a
286286
C<ARGS-TO-CAPTURE> subroutine yourself, or by importing one from any of
287287
the L<Getopt|https://modules.perl6.org/search/?q=getopt> modules available
288288
in the ecosystem.
@@ -295,7 +295,7 @@ representing the C<MAIN> unit to be executed (so it can be introspected if
295295
necessary) and an array with the arguments from the command line. It
296296
should return a L<Capture|/type/Capture> object that should be used to
297297
dispatch the C<MAIN> unit. A B<very> contrived example that will create
298-
a C<Capture> dependin on some keyword that was entered (which can be handy
298+
a C<Capture> depending on some keyword that was entered (which can be handy
299299
during testing of a command line interface of a script):
300300
301301
sub ARGS-TO-CAPTURE(&main, @args --> Capture) {
@@ -308,7 +308,7 @@ during testing of a command line interface of a script):
308308
}
309309
310310
Note that the dynamic variable L<&*ARGS-TO-CAPTURE> is available to perform
311-
the default command line arguments to C<Capture> processing, so you don't
311+
the default command line arguments to C<Capture> processing so you don't
312312
have to reinvent the whole wheel if you don't want to.
313313
314314
X<|&*ARGS-TO-CAPTURE>
@@ -320,7 +320,7 @@ parameters as are expected of the custom C<ARGS-TO-CAPTURE> subroutine.
320320
321321
=head1 Intercepting usage message generation (2018.10, v6.d and later)
322322
323-
You can replace / augment the default way of usage message generation
323+
You can replace or augment the default way of usage message generation
324324
(after a failed dispatch to MAIN) by supplying a C<GENERATE-USAGE> subroutine
325325
yourself, or by importing one from any of the
326326
L<Getopt|https://modules.perl6.org/search/?q=getopt> modules available in the
@@ -353,7 +353,7 @@ You can also use multi subroutine to create the same effect:
353353
}
354354
355355
Note that the dynamic variable L<&*GENERATE-USAGE> is available to perform
356-
the default usage message generation, so you don't have to reinvent the
356+
the default usage message generation so you don't have to reinvent the
357357
whole wheel if you don't want to.
358358
359359
X<|&*GENERATE-USAGE>

0 commit comments

Comments
 (0)