From: Greg Sabino Mullane Date: Thu, 30 Oct 2014 21:02:50 +0000 (-0400) Subject: Merge dbname2, host2, etc. into the new array method. X-Git-Tag: 2.22.0~21 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=900b0887df0f7367b33b0576102df1d8a937cef4;p=check_postgres.git Merge dbname2, host2, etc. into the new array method. --- diff --git a/check_postgres.pl b/check_postgres.pl index f68167cce..a48e36fba 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1001,22 +1001,22 @@ while (my $arg = pop @ARGV) { if ($arg =~ /^\-?\-?(\w+)\s*=\s*(.+)/o) { my ($name,$value) = (lc $1, $2); if ($name =~ /^(?:db)?port(\d+)$/o or $name =~ /^p(\d+)$/o) { - $opt{"port$1"} = $value; + push @{ $opt{port} } => $value; } elsif ($name =~ /^(?:db)?host(\d+)$/o or $name =~ /^H(\d+)$/o) { - $opt{"host$1"} = $value; + push @{ $opt{host} } => $value; } elsif ($name =~ /^db(?:name)?(\d+)$/o) { - $opt{"dbname$1"} = $value; + push @{ $opt{dbname} } => $value; } elsif ($name =~ /^dbuser(\d+)$/o or $name =~ /^u(\d+)/o) { - $opt{"dbuser$1"} = $value; + push @{ $opt{dbuser} } => $value; } elsif ($name =~ /^dbpass(\d+)$/o) { - $opt{"dbpass$1"} = $value; + push @{ $opt{dbpass} } => $value; } elsif ($name =~ /^dbservice(\d+)$/o) { - $opt{"dbservice$1"} = $value; + push @{ $opt{dbservice} } => $value; } else { push @badargs => $arg;