We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaefb74 commit 8b0fa34Copy full SHA for 8b0fa34
doc/Language/create-cli.pod6
@@ -196,6 +196,28 @@ Usage:
196
--verbose required verbosity
197
=end code
198
199
+C<Enumeration>s can be used in signatures with arguments converted
200
+automatically to its corresponding C<enum> symbol:
201
+
202
+=begin code
203
+enum Flags (
204
+ FLAG_FOO => 0b001,
205
+ FLAG_BAR => 0b010,
206
+ FLAG_BAZ => 0b100,
207
+);
208
209
+sub MAIN( Enumeration $flag = FLAG_FOO) {
210
+ say "Flagging $flag";
211
+}
212
+=end code
213
214
+This will work correctly with
215
216
+=for code :lang<text>
217
+raku MAIN-enum.p6 FLAG_BAR
218
219
+but will die if called with something that is not an enum.
220
221
X<|%*SUB-MAIN-OPTS>
222
=head2 %*SUB-MAIN-OPTS
223
0 commit comments