parrotcode: Options processing functionality for | |
Contents | Perl Modules |
Parrot::Configure::Options::Conf::File - Options processing functionality for Parrot's configuration-file interface
use Parrot::Configure::Options::Conf::File qw( @valid_options $script %options_components $parrot_version $svnid );
This package exports five variables on demand.
%options_components @valid_options $script $parrot_version $svnid
Typically, only one of these -- %options_components
-- is directly imported by Parrot::Configure::Options for use in the case where options are supplied to Configure.pl on the command-line. But all five are, in principle, importable by other packages.
%options_components
%options_components = ( 'valid_options' => \@valid_options, 'script' => $script, 'short_circuits' => \%short_circuits, 'conditionals' => \&conditional_assignments, );
Hash with four elements keyed as follows:
valid_options
Reference to an array holding a list of options are valid when configuring Parrot via the traditional Command-Line interface. The options are documented when you call perl Configure.pl --help
and include --ask
to request interactive configuration.
script
Defaults to string 'Configure.pl', but may be overridden for testing purposes.
short_circuits
Reference to a hash with two elements:
help
Reference to subroutine print_help
, which prints Configure.pl's help message. Since this subroutine is shared with another package, it is actually imported from Parrot::Configure::Options::Conf.
version
Reference to subroutine print_version
, which prints Configure.pl's version number. Since this subroutine is shared with another package, it is actually imported from Parrot::Configure::Options::Conf.
conditionals
Reference to a subroutine private to this package which:
debugging
and maintainer
options under most situations.The subroutine takes a single argument: a reference to a hash holding elements concerned with configuration, such as the valid options.
The subroutine returns a two-argument list:
That's probably difficult to understand at first. So here is an example of how $options_components->{conditionals}
is actually used inside Parrot::Configure::Options::process_options()
.
my $data; # $data is hash ref which gets assigned some key-value pairs my $steps_list_ref; ($data, $steps_list_ref) = &{ $options_components->{conditionals} }($data);
The functionality in this package originally appeared in Configure.pl. It was transferred here and refactored by James E Keenan.
Configure.pl. Parrot::Configure::Options. Parrot::Configure::Options::Conf. Parrot::Configure::Options::Reconf. Parrot::Configure::Options::Conf::CLI.
|