mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-01 18:25:59 +00:00
Added test. Updated all modules
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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};
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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>"
|
||||
|
Reference in New Issue
Block a user