Created
October 8, 2014 17:43
-
-
Save peschwa/f5aa95ef7e751572924e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/HLL/CommandLine.nqp b/src/HLL/CommandLine.nqp | |
index 3e579fe..f936952 100644 | |
--- a/src/HLL/CommandLine.nqp | |
+++ b/src/HLL/CommandLine.nqp | |
@@ -42,18 +42,33 @@ and C<arguments>. | |
The C<.new> method and constructor expects an array with option specifications. | |
Such a specification is the name of an option, optionally followed by the | |
C<=> equals sign and a single character describing the kind of value it expects. | |
-Missing value specification or C<b> stand for C<bool>, ie the option does not | |
-expect a value. C<s> stands for a string value. | |
+Missing value specification or C<b> stand for C<bool>, i.e. the option does not | |
+expect a value. C<s> stands for a single string value, while C<S> stands for | |
+(potentially) multiple string values, which allows supplying the same option | |
+more than once. C<d> set the option as deprecated, and can be followed by | |
+one or two dashes and a supported alternatives with the same function. | |
Optional values are only supported for string values so far. For the | |
value specified with C<s?> the value will default to ''. | |
+The following is a subset of Rakudo's HLL::CommandLine::Parser spec as an | |
+example: | |
+ | |
+ my @spec := < | |
+ e=s | |
+ h|help | |
+ I=S | |
+ E=d-e | |
+ >; | |
+ | |
=head2 add-stopper(String) | |
Adds a stopper. A stopper is a special value that, when encountered in the | |
command line arguments, terminates the processing, and classifies the rest | |
of the strings as arguments, independently of their form. C<--> is a | |
pre-defined stopper. If an option is used a stopper, that option itself is | |
-still processed. | |
+still processed. Being a stopper trumps being used multiple times, i.e. a | |
+stopper C<foo> that is defined as C<foo=S> can only ever be parsed once as | |
+an option. | |
Examples: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment