Hello fellow monks! It is good to once again tread these hallowed halls after all these moons of moons.
I have been a fan of modulinos (thanks Brian D'Foy!) for a long time now because of the advantages for testability. I have also been a fan of Moo for several years. And of course, like many others, I have combined both techniques with Getopt::Long. I have also been using a standard set of command line options such as "--debug" and "--help", with "--debug" defaulting true so "--nodebug" is required to turn it off.
In an effort to reduce boilerplate and a lot of copy-and-paste I wrote a simple Moo role to handle the basics for me. I have since refined it with a proper test suite and POD and it has now been released as MooX::Role::CliOptions. I would greatly appreciated any feedback from my brothers and sisters of the Monastery on any and all aspects.
I am well aware that there are other ways of doing this, including a couple of other modules on CPAN. I hope that some will find this new Role to be easier to use in some respects, as well as being more "Moo-ish".
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Moo and command line scripts
by tobyink (Canon) on Nov 09, 2019 at 11:23 UTC | |
by boftx (Deacon) on Nov 09, 2019 at 20:11 UTC | |
by tobyink (Canon) on Nov 11, 2019 at 08:42 UTC |