Added test. Updated all modules

This commit is contained in:
Carlos Salguero
2016-10-27 13:39:51 -03:00
parent c61ce0f3db
commit 74eb8b72c0
28 changed files with 156 additions and 2 deletions

View File

@@ -480,6 +480,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1209,6 +1209,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1207,6 +1207,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -557,6 +557,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -553,6 +553,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1544,6 +1544,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -481,6 +481,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -973,6 +973,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -482,6 +482,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -552,6 +552,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1304,6 +1304,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1134,6 +1134,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -562,6 +562,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -570,6 +570,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1802,6 +1802,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -483,6 +483,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -555,6 +555,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -490,6 +490,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -707,6 +707,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -2231,6 +2231,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -570,6 +570,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1575,6 +1575,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1799,6 +1799,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -559,6 +559,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -1156,6 +1156,12 @@ sub get_opts {
$self->{errors} = [];
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}
if ( @ARGV && $ARGV[0] eq "--config" ) {
shift @ARGV;
$self->_set_option('config', shift @ARGV);

View File

@@ -147,7 +147,7 @@ sub parse {
foreach my $key ( keys %$opts ) {
PTDEBUG && _d('Finding value for', $key);
$final_props{$key} = $given_props{$key};
if ( !defined $final_props{$key}
if ( !defined $final_props{$key}
&& defined $prev->{$key} && $opts->{$key}->{copy} )
{
$final_props{$key} = $prev->{$key};

View File

@@ -618,7 +618,7 @@ sub get_opts {
if ( @ARGV && $ARGV[0] =~/^--config=/ ) {
$ARGV[0] = substr($ARGV[0],9);
# Clean '" independently because we need to match start/end with the same char ' or "
$ARGV[0] =~ s/^'(.*)'$/$1/
$ARGV[0] =~ s/^'(.*)'$/$1/;
$ARGV[0] =~ s/^"(.*)"$/$1/;
$self->_set_option('config', shift @ARGV);
}

View File

@@ -1595,6 +1595,10 @@ ok(
'Parses special --config option first',
);
@ARGV = ("--config=$trunk/t/lib/samples/empty",'--cat');
$o->get_opts();
ok($o->got('config'), 'Got --config=');
$o = new OptionParser(
description => 'OptionParser.t parses command line options.',
usage => "$PROGRAM_NAME <options>"