Parrot::Configure::Options - Process command-line options to Configure.pl
use Parrot::Configure::Options qw( process_options ); $args = process_options( { mode => q{configure}, argv => [@ARGV], } );
Parrot::Configure::Options exports on demand the subroutine process_options(), which processes the command-line options provided to Configure.pl or to tools/dev/reconfigure.pl.
process_options()
If you provide Configure.pl with either --help or --version, process_options() will print out the appropriate message and perform a bare return, i.e., the return value will be undef. The calling script -- whether Configure.pl or a test file -- can then check for the definedness of process_options()'s return value and proceed appropriately.
--help
--version
return
undef
An array of valid command-line option names stored internally is consulted; the program will die if an invalid option is called.
Purpose
Process command-line options provided to Configure.pl and proceed appropriately.
Arguments
One argument: Reference to a hash holding the following key-value pairs:
mode : 'configure', 'reconfigure' or 'file' argv : reference to @ARGV; defaults to []
Return Value
--version or --help options
Bare return (undef).
All other options
Reference to a hash of option names and values.
Comment
The mode element in the argument to process_options() should be set according to the following rules:
mode
configure
Command-Line Interface: Initial Parrot configuration with zero or more command-line options (other than the --file option). This is the most typical case. See Configure.pl or any test file simulating the functionality of Configure.pl in the t/configure/ or t/steps/ directories.
--file
file
Configuration-File Interface: Initial Parrot configuration where the options are stored in a configuration file whose location is the value of the sole command-line option --file.
reconfigure
After Configure.pl has completed, some Parrot developers need to rerun a particular configuration step (typically, gen::makefiles) to debug revisions. tools/dev/reconfigure.pl with the --step=step::class option does this and internally calls process_options() in reconfigure mode.
gen::makefiles
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::Conf. Parrot::Configure::Options::Reconf. Parrot::Configure::Options::Conf::CLI. Parrot::Configure::Options::Conf::File.
To install Parrot::Op, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parrot::Op
CPAN shell
perl -MCPAN -e shell install Parrot::Op
For more information on module installation, please visit the detailed CPAN module installation guide.