Drop use of = in parsing arguments in raku

Viewed 166

The fact that you can write in raku the following

unit sub MAIN(Int $j = 2);

say $j

is amazing, and the fact that the argument parsing is done for you is beyond useful. However I find personally extremely unergonomic that for such arguments you habe to write a = to set the value, i.e.

./script.raku -j=5

I was wondering if there is a way to tell the parser that it should allow options without the = so that I can write

./script.raku -j 5

I haven't seen this in the docs and this would really be much more intuitive for some people like me. If it is not currently possible, I think it would be a useful add-on.

2 Answers

There has been a lot of discussion of how command line parameters should be parsed. At the moment there are no plans of adding more functionality to what Raku provides out of the box.

If you want more tweakability, you should probably look at the Getopt::Long module by Leon Timmermans

Related