Author: particle
Date: 2009-01-09 22:05:46 +0100 (Fri, 09 Jan 2009)
New Revision: 24846
Modified:
docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] describe how to avoid ambiguity when nesting delimited options
Modified: docs/Perl6/Spec/S19-commandline.pod
===================================================================
--- docs/Perl6/Spec/S19-commandline.pod 2009-01-09 21:03:17 UTC (rev 24845)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-01-09 21:05:46 UTC (rev 24846)
@@ -276,10 +276,8 @@
The opening and closing delimiters begin with two or more plus characters,
for example C<++>. You'll usually use two plus characters, but more are
-allowed to avoid ambiguity.
+allowed to avoid ambiguity when nesting delimited options.
-{{TODO put more below, or refer to somewhere with more}}
-
=item *
Opening and closing delimited option names follow option identifier naming
@@ -311,9 +309,26 @@
++PARSER --prelude=Perl6-autoloop-no-print ++/PARSER
is available inside your script as C<< %+OPTS<PARSER> >>, and contains
-C<--prelude=Perl6-autoloop-no-print>.
+C<--prelude=Perl6-autoloop-no-print>. Since eager matching is used, if you
+need to pass something like:
+ ++foo -bar ++foo baz ++/foo ++/foo
+you'll end up with
+
+ %+OPTS<foo> = '-bar ++foo baz';
+
+which is probably not what you wanted. Instead, add extra C<+> characters
+
+ +++foo -bar ++foo baz ++/foo +++/foo
+
+which will give you
+
+ %+OPTS<foo> = '-bar ++foo baz ++/foo';
+
+allowing you to properly nest delimited options.
+
+
Values are parsed with the following rules:
=over 4