On Nov 29, 2004, at 8:14 PM, Randy W. Sims wrote:
How about moving it into a separate class so that each M::B instance
can have, as a property, an M::B::OptionManager class? This would
tighten up the inteface to the options and move the option handling
into a dedicated class.
I like it. I've wanted to go further and have Getopt::Long handle all
of the comand-line arguments, but there are two problems with that:
1. It won't work for commands without "--" or "-", such as "verbose=1".
But those could be parsed out separately.
2. Turning flags on and off requires an argument with M::B options,
such as "--verbose 1" instead of just "--verbose" or "--no-verbose"
as is supported by Getopt::Long. I like the latter better but to
remove the former would break backwards compatability with earlier
M::B versions and with E::MM. How do folks feel about that?
Additionally, it'd be nice if ACTIONs could register the options that
it would accept:
$self->{plugin_manager}->register_options(
# action option format
install => { install_base => '$',
installdirs => '$',
...
},
build => {...},
Build.PL => {...},
);
Subclasses/plugins would also be able easily to do the same.
Ah, yes, that makes a *lot* of sense.
This way we can catch errors. I've always hated that with make based
installs, you could type pretty much anything and never get feedback
on whether it worked or failed:
make PERFIX=~
The above will happily be accepted without complaint, but the results
will likely be a suprise. Same with
perl Build install intsall_base=X:\home\Administrator
Right, catching errors is good. But it would break the way CPANPLUS
works for me right now, in that it passes "uninst=1 UNINST=1" to every
"make" or "./Build" command. I can live with that, though.
Regards,
David
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
|