From 0a85487e37e9ef3ce5ddb155420c71e4c5bdfe2d Mon Sep 17 00:00:00 2001 From: Brian Koontz Date: Tue, 14 Jul 2015 15:26:55 -0600 Subject: [PATCH] Added support for reading credentials from .pgpass (using -w switch). --- postgresql_autodoc.1.in | 4 ++++ postgresql_autodoc.pl | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/postgresql_autodoc.1.in b/postgresql_autodoc.1.in index 82dd7bf..2eb7faf 100644 --- a/postgresql_autodoc.1.in +++ b/postgresql_autodoc.1.in @@ -38,6 +38,10 @@ Specify database password (default: blank) If no password is specified, one is prompted for. .TP +.B \-w +Use ~/.pgpass for authentication (overrides all other password options) +.TP + .B \-l Path to the templates (default: @@TEMPLATE-DIR@@) .TP diff --git a/postgresql_autodoc.pl b/postgresql_autodoc.pl index 52d9abf..41aac1e 100755 --- a/postgresql_autodoc.pl +++ b/postgresql_autodoc.pl @@ -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 { -- 2.50.1