Skip to content

Commit 900b088

Browse files
author
Greg Sabino Mullane
committed
Merge dbname2, host2, etc. into the new array method.
1 parent 5cb4297 commit 900b088

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

check_postgres.pl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,22 +1001,22 @@ package check_postgres;
10011001
if ($arg =~ /^\-?\-?(\w+)\s*=\s*(.+)/o) {
10021002
my ($name,$value) = (lc $1, $2);
10031003
if ($name =~ /^(?:db)?port(\d+)$/o or $name =~ /^p(\d+)$/o) {
1004-
$opt{"port$1"} = $value;
1004+
push @{ $opt{port} } => $value;
10051005
}
10061006
elsif ($name =~ /^(?:db)?host(\d+)$/o or $name =~ /^H(\d+)$/o) {
1007-
$opt{"host$1"} = $value;
1007+
push @{ $opt{host} } => $value;
10081008
}
10091009
elsif ($name =~ /^db(?:name)?(\d+)$/o) {
1010-
$opt{"dbname$1"} = $value;
1010+
push @{ $opt{dbname} } => $value;
10111011
}
10121012
elsif ($name =~ /^dbuser(\d+)$/o or $name =~ /^u(\d+)/o) {
1013-
$opt{"dbuser$1"} = $value;
1013+
push @{ $opt{dbuser} } => $value;
10141014
}
10151015
elsif ($name =~ /^dbpass(\d+)$/o) {
1016-
$opt{"dbpass$1"} = $value;
1016+
push @{ $opt{dbpass} } => $value;
10171017
}
10181018
elsif ($name =~ /^dbservice(\d+)$/o) {
1019-
$opt{"dbservice$1"} = $value;
1019+
push @{ $opt{dbservice} } => $value;
10201020
}
10211021
else {
10221022
push @badargs => $arg;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy