Added support for reading credentials from .pgpass (using -w switch).
authorBrian Koontz <brianko@gmail.com>
Tue, 14 Jul 2015 21:26:55 +0000 (15:26 -0600)
committerBrian Koontz <brianko@gmail.com>
Tue, 14 Jul 2015 21:30:36 +0000 (15:30 -0600)
postgresql_autodoc.1.in
postgresql_autodoc.pl

index 82dd7bf1313a09263fb11157bd002cf12f61970b..2eb7fafdfa1a915f1bb81df9c77ca7c4dcbbbefe 100644 (file)
@@ -38,6 +38,10 @@ Specify database password (default: blank)
 \r
 If no password is specified, one is prompted for.\r
 .TP\r
+.B \-w\r
+Use ~/.pgpass for authentication (overrides all other password options)\r
+.TP\r
+\r
 .B \-l <path>\r
 Path to the templates (default: @@TEMPLATE-DIR@@)\r
 .TP\r
index 52d9abf3b391b36eea8430422377c77d4a8c2fb1..41aac1e0d6ca91ae5d837e7a14a0d08e5b9c4ee4 100755 (executable)
@@ -152,6 +152,14 @@ sub main($) {
                 last;
             };
 
+           # Read from .pgpass (override all other password options)
+           /^-w$/ && do {
+               $dbpass = undef;
+               $dbuser = undef;
+                $needpass = 0;
+               last;
+           };
+
             # Set the base of the filename. The extensions pulled
             # from the templates will be appended to this name
             /^-f$/ && do {