Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguements type-constrained to an enum prevent this module from working #5

Open
codesections opened this issue Jul 6, 2020 · 1 comment

Comments

@codesections
Copy link

SuperMAIN functions correctly with a module like

use SuperMAIN;

sub MAIN(Str :$named, Str :$other-named) { say $named; }

which can be used as follows:

$ raku SuperMAIN-test.raku -n test_name
test_name

But if I add an enum option like this

use SuperMAIN;

enum Option <one two>;
sub MAIN(Str :$named, Str :$other-named, Option :$option ) { say $named; }

It no longer works:

$ raku SuperMAIN-test.raku -o one
Usage:
  SuperMAIN-test.raku [--named=<Str>] [--other-named=<Str>] [--option=<Option> (one two)]

The presence of that enum option also stops other options from being processed correctly:

$ raku SuperMAIN-test.raku -n test_name --option=one
Usage:
  SuperMAIN-test.raku [--named=<Str>] [--other-named=<Str>] [--option=<Option> (one two)]

The form built in to Raku still works, however:

$ raku SuperMAIN-test.raku --named=test_name --option=one
test_name
@nxadm
Copy link
Owner

nxadm commented Jul 6, 2020

I need to look a little deeper into this one, but It's certainly something to add to the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants