I'm working on a subclass of CPAN::Mini that will store the local mirror in an SCM repository. This subclass needs some extra configuration parameters (like the repository URL). I'd like to put these in the .minicpanrc file and reuse minicpan as the front-end, but CPAN::Mini::App will only pass along a specific set of paramerters to the CPAN::Mini constructor.
My fork passes all the available config parameters to the CPAN::Mini constructor. This allows subclass authors to specify additional config file parameters for their subclass. I accomplished this by changing the way GetOptions is used, and by normalizing the names of the command-line switches to match those of the keys of the CPAN::Mini constructor. I also added aliases for several command-line switches to so the public interface still looks the same. Finally, all the command-line and configuration parameters are merged and passed to the CPAN::Mini constructor.
I admit this feels a bit hackish. But the goal seems honorable. I'm open to suggestions if you see a better way to go. BTW: I'd ultimately like to allow suclasses to extend the command-line with additional switches, but I haven't thought about that yet.
Thanks for the great work!
Pass all config parameters to CPAN::Mini->new().
Added test case for the -perl switch.
This was the one command-line switch that I had
to munge (into 'skip_perl') so that I could just
merge the hash of command-line parameters with the
hash of config-file parameters.
I have pulled this into master. Thanks very much, and I sincerely apologize for the ridiculous delay in applying this. I have no excuse!