Skip to content

Commit

Permalink
create-cli: Minor improvements to enum example
Browse files Browse the repository at this point in the history
  • Loading branch information
softmoth committed Jun 7, 2020
1 parent d697243 commit 6cfa4a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/Language/create-cli.pod6
Expand Up @@ -200,23 +200,23 @@ C<Enumeration>s can be used in signatures with arguments converted
automatically to its corresponding C<enum> symbol:
=begin code
enum Flags (
enum Flag (
FLAG_FOO => 0b001,
FLAG_BAR => 0b010,
FLAG_BAZ => 0b100,
);
sub MAIN( Enumeration $flag = FLAG_FOO) {
sub MAIN(Flag $flag = FLAG_FOO) {
say "Flagging $flag";
}
=end code
This will work correctly with
=for code :lang<text>
raku MAIN-enum.p6 FLAG_BAR
raku MAIN-enum.raku FLAG_BAR
but will die if called with something that is not an enum.
but will die if called with something that is not a C<Flag>.
X<|%*SUB-MAIN-OPTS>
=head2 %*SUB-MAIN-OPTS
Expand Down

0 comments on commit 6cfa4a3

Please sign in to comment.