File Coverage

File:lib/Parrot/Configure/Options/Reconf.pm
Coverage:100.0%

linestmtbrancondsubcode
1# Copyright (C) 2007-2010, Parrot Foundation.
2
3package Parrot::Configure::Options::Reconf;
4
5
103
103
103
use strict;
6
103
103
103
use warnings;
7
103
103
103
use base qw( Exporter );
8our @EXPORT_OK = qw(
9    @valid_options
10    $script
11    %options_components
12);
13
14our @valid_options = qw{
15    ask
16    debugging
17    help
18    lex
19    maintainer
20    step
21    target
22    verbose
23    yacc
24};
25
26our $script = q{tools/dev/reconfigure.pl};
27
28my %short_circuits = ( help => \&print_help, );
29
30our %options_components = (
31    'valid_options' => \@valid_options,
32    'script' => $script,
33    'short_circuits' => \%short_circuits,
34    'conditionals' => \&conditional_assignments,
35);
36
37sub conditional_assignments {
38
10
    my $argsref = shift;
39
10
    $argsref->{debugging} = 1
40        unless ( ( exists $argsref->{debugging} ) && !$argsref->{debugging} );
41
10
    $argsref->{maintainer} = 1
42        if defined $argsref->{lex}
43            or defined $argsref->{yacc};
44
10
    return $argsref;
45}
46
47sub print_help {
48
2
    print <<"EOT";
49$script
50
51General Options:
52
53   --help Show this text
54   --verbose Output extra information
55   --step=(gen::makefiles)
56                        Execute a single configure step
57   --target=(Makefile) Regenerate a specific makefile
58
59   --ask Have Configure ask for commonly-changed info
60
61Compile Options:
62
63   --debugging=0 Disable debugging, default = 1
64   --lex=(lexer) Use the given lexical analyzer generator
65   --yacc=(parser) Use the given parser generator
66EOT
67
2
    return 1;
68}
69
701;
71
72# Local Variables:
73# mode: cperl
74# cperl-indent-level: 4
75# fill-column: 100
76# End:
77# vim: expandtab shiftwidth=4: